Git Product home page Git Product logo

lovebox's People

Contributors

julisa99 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

lovebox's Issues

Wemos D1 mini Pro isn't able to retrieve message from Gist file

Hi! I was trying to replicate this project on my D1 mini Pro and realised that it wasn´t being able to fetch the message from my gist file in any way.
I even tested all the componnents to look for any flaw on their connctions, but there is any and the Servo, Display and light sensor are working correctly. I am really lost, because it is indeed connecting to the WiFi (If I use my cellphone's conection as a router, it appears as a connected device) and my Gist url is written as /GitHub-username/Hash-Value/raw, but it still doesn't work.
Can somebody help me PLEASE?
Thanks :)

Hello with gist

Hello,

first thanks for this amazing project.

Like you know chrismas coming :) and i want build this project for my girlfriend.

for the moment your program compil well and i have the message <3 LoveBox <3 appear on my screnn YESSS !!!!

But my probleme is about message on GIT.

I go to GIT i login , i click on "your gist" then i create new file name "test" inside i put that :

1
t
hello

Like i understand (let me know if i'm wrong)

  1. 1 --> your program see if différent number if yes he go to the net line to see if is "t" or someting else
  2. t --> your program detect the message is a texte message but if we have another letter your programe detect img
    3 ) hello --> message to show

so i've Two question if i'm correct on 1,2 and 3 why my message not appear ? My wireless works perfectly and i make my pat to my gist like this :
myusernameGIT/420b6eb87445c1eb50fb365b28fb7503.js/raw/test
maybe i mistake something ?

the second question can you explain me what you do exactly to show img.

for me i understant that :

  1. 1 --> your program see if différent number if yes he go to the net line to see if is "t" or someting else
  2. w --> your program detect the message is a texte message if we make "t" letter but if we have another letter your programe detect img
    3 ) here i need make img ? or only the binary code 0001111 img convert on the website you give ?

Thanks for your amazing works and your help.

Light sensor link is broken

Hi Lisa.

Unfortunately the link to the light sensor is broken.
Can you tell me what kind of sensor i need to buy or provide a different link?

Thanks :)

#include "credentials.h"

I keep getting this error message:
credentials.h: No such file or directory

Is there another library I need in order to use this?

Display Error with binary images

First of all thank you very much for this cute tiny cool box! I almost finished my first box. Unfortunately I have trouble with the display when using images. Every time the image is loaded another image with errors in the lower half / third of the display is shown. It seems that there is something shifted wrong. I attached some example images of that. Do you have any idea what's the cause? I already reduced the I2C clock down to 100kHz, used another display from another provider, added pull up resistors to the I2C pins. Nothing helped so far.

image

image

image

Microcontroller seems to never check gist after first time

I have everything built and the code is uploaded. However after getting the first message it seems the code just stops checking for the new message. The while loop appears to just stop after the first time (I know this because my code is no longer looking for the lightValue).

SSD1306Wire.h Not included

Hello!
I absolutely love this project but due to this file not being included I am confused as to how to include it. I tried to find the file online but it does not match up. I am not the most advanced with coding so if you could include or explain how to get the file it would be much appreciated. Thank you so much!

Help HTTPS request doesn't work

Hi,
I have been at this for 2 months (crying face).
This is my first time using Arduino so could be a very easy fix.
When this code is run it prints "Connection to GitHub lost" which from what I know just means it's not even connecting to the git file.

Here is the txt file : https://gist.githubusercontent.com/thomasmore72/b3ca747d9852fbe407a11e629d854f96/raw/28a9bccb6b4e0f4d163644063b5a092e29700ed0/gistfile1.txt

Like I said brand new to this so if you have a potential solution I might need a bit of code to understand :D

#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
#include <EEPROM.h>
#include <Servo.h>
#include "SSD1306Wire.h"

const String url = "/thomasmore72/b3ca747d9852fbe407a11e629d854f96/raw/28a9bccb6b4e0f4d163644063b5a092e29700ed0/gistfile1.txt";

SSD1306Wire oled(0x3C, D2, D1);
Servo myservo; 
int pos = 90;
int increment = -1;
int lightValue;
String line;
String messageMode;
char idSaved; 
bool wasRead;  

void drawMessage(const String& message) {
  oled.clear();

  // differentiat between 't'ext and image message
  if(messageMode[0] == 't'){
    oled.drawStringMaxWidth(0, 0, 128, message);    
  } 
  else {
    for(int i = 0; i <= message.length(); i++){
      int x = i % 129;
      int y = i / 129;
    
      if(message[i] == '1'){
        oled.setPixel(x, y);
      }
    } 
  }    
  oled.display();
}

void wifiConnect() {
  Serial.begin(9600);
  Serial.println();

  WiFi.begin("Wifi Name", "Wifi Pass");

  Serial.print("Connecting");

  while (WiFi.status() != WL_CONNECTED) {
    delay(1000);
    Serial.print(".");
  }
  
  if (WiFi.status() == WL_CONNECTED) {
    Serial.print("Connected, IP address: ");
    Serial.println(WiFi.localIP());
  }
}

void getGistMessage() {
  const int httpsPort = 443;
  const char* host = "gist.githubusercontent.com";
  const char fingerprint[] = "A1 46 14 C7 2A 1D 52 79 F6 AA 2B B2 C5 0A 3B D3 F5 02 06 75";
  
  WiFiClientSecure client;
  client.setFingerprint(fingerprint);
  
  if (!client.connect(host, httpsPort)) {
    Serial.println("Failed to connect to GitHub");
    return; // failed to connect
  }
  
  client.print(String("GET ") + "/thomasmore72/b3ca747d9852fbe407a11e629d854f96/raw/28a9bccb6b4e0f4d163644063b5a092e29700ed0/gistfile1.txt" + " HTTP/1.1\r\n" +
               "Host: " + host + "\r\n" +
               "User-Agent: ESP8266\r\n" +
               "Connection: close\r\n\r\n");

  // Wait for a response
  if (!client.connected()) {
    Serial.println("Connection to GitHub lost");
    client.stop();
    return;
  }

  // Read the response status code
  String response = client.readStringUntil('\n');
  if (!response.startsWith("HTTP/1.1 200 OK")) {
    Serial.println("GitHub request failed with status: " + response);
    client.stop();
    return;
  }

  while (client.connected()) {
    String temp = client.readStringUntil('\n');
    if (temp == "\r") {
      break;
    }
  }

  //String id = client.readStringUntil('\n'); 
  if(response[0] != idSaved){ // new message
    messageMode = client.readStringUntil('\n');
    if (messageMode[0] == 't'){
      line = client.readStringUntil(0);
    } else {
      // binary image is corrupted if readStringUntil() takes too long
      // fix: read string line by line
      line = "";
      for (int i = 0; i < 64; i++)     
      {
        line += client.readStringUntil('\n');
        line += "\n";
      }
      if (line.length() != 8256)
      {
        getGistMessage();
      }
    }
    wasRead = 0;
    idSaved = response[0];
    EEPROM.write(142, idSaved);
    EEPROM.write(144, wasRead);
    EEPROM.commit(); 
    drawMessage(line);
  }
}

void setup() {
  myservo.attach(16);       // Servo on D0
  
  oled.init();
  oled.flipScreenVertically();
  oled.setColor(WHITE);
  oled.setTextAlignment(TEXT_ALIGN_LEFT);
  oled.setFont(ArialMT_Plain_10);
     
  oled.clear();
  oled.drawString(30, 30, "<3 LOVEBOX <3");
  oled.display();
  
  wifiConnect();

  EEPROM.begin(512);
  idSaved = EEPROM.get(142, idSaved);
  wasRead = EEPROM.get(144, wasRead);
}

void loop() {
  if (WiFi.status() != WL_CONNECTED) {
    wifiConnect();
  }
  
  getGistMessage();   
  Serial.print("/");
  delay(5000); // wait a minute before request gist again
}

.

.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.