Display over air

Hi there,

is anyway a project tah will integrate oled siplay and adition gateway (ESP8266), to show data from one or more sensors over air, not with cables.
Something like this

Thanks

2 Likes

https://github.com/pjgueno/SCClock

It does exactly what you want. You can easily supply it with an 18650 accu.

It should not be that complicated to add a screen.

Thanks, just addin the screen is not a problem.
But I have to seat down and play a little bit with code.

But I think that so one comunnity really need it.

You can copy the SSD1306 part from the code in the main firmware.
I can help you.
You can fork and PR in GitHub if you want.

Thats very nice from U, where to copy?
Also it will be nice to have support for biger 2,4" screen, that can be somethinl like “official” Comunity sensor wheter station projekt start.

Thanx

The screen on the picture is a generic OLED screen which is already used by the firmware (with I2C which is quite good). If you want a TFT 2.4" screen it would be much more complicated.

Check lines 511 and 3533 for example.
Can you code a bit ?

Thx, I can code some Basics.
I just create simple script but I was unable to get data from server.
I just want to start with some simple.

#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h> // http web access library
#include <ArduinoJson.h> // JSON decoding library
// Libraries for SSD1306 OLED display
#include <Wire.h> // include wire library (for I2C devices such as the SSD1306 display)
#include <Adafruit_GFX.h> // include Adafruit graphics library
#include <Adafruit_SSD1306.h> // include Adafruit SSD1306 OLED display driver
 
#define OLED_RESET 5 // define SSD1306 OLED reset at ESP8266 GPIO5 (NodeMCU D1)
Adafruit_SSD1306 display(OLED_RESET);
 
// set Wi-Fi SSID and password
const char *ssid = "";
const char *password = "";
 
void setup(void)
{
Serial.begin(9600);
delay(1000);
 
Wire.begin(4, 0); // set I2C pins [SDA = GPIO4 (D2), SCL = GPIO0 (D3)], default clock is 100kHz
 
// by default, we'll generate the high voltage from the 3.3v line internally! (neat!)
display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // initialize with the I2C addr 0x3D (for the 128x64)
// init done
 
Wire.setClock(400000L); // set I2C clock to 400kHz
 
display.clearDisplay(); // clear the display buffer
display.setTextColor(WHITE, BLACK);
display.setTextSize(1);
display.setCursor(0, 0);
display.println(" Internet Weather");
display.print(" Station - Jaipur");
Serial.println(" Internet Weather");
Serial.print(" Station - Jaipur");
display.display();
 
WiFi.begin(ssid, password);
 
Serial.print("Spajanje na WIFI\n");
Serial.println(ssid);
display.setCursor(0, 24);
display.println("Spajanje...");
display.display();
while ( WiFi.status() != WL_CONNECTED )
{
delay(500);
Serial.print(".");
}
Serial.println("spojeno");
display.print("spojeno");
display.display();
delay(1000);
 
}
 
void loop()
{
if (WiFi.status() == WL_CONNECTED) //Check WiFi connection status
{
HTTPClient http; //Declare an object of class HTTPClient
 
// specify request destination
http.begin("data.sensor.community/airrohr/v1/sensor/70977/");
const int httpsPort = 443;
 
int httpCode = http.GET(); // send the request
 
if (httpCode > 0) // check the returning code
{
String payload = http.getString(); //Get the request response payload
 
DynamicJsonBuffer jsonBuffer(512);
 
// Parse JSON object
JsonObject& root = jsonBuffer.parseObject(payload);
if (!root.success()) {
Serial.println(F("Parsing failed!"));
return;
}
 
float pm1 = (float)(root["0"]["value"]);
int pm2 = root["main"]["humidity"]; 
float temperatura = (float)(root["main"]["pressure"]); 
float vlaga = root["wind"]["speed"];
 
// print data
Serial.printf("PM 2,5 = %.2f°C\r\n", pm1);
Serial.printf("PM 10 = %d %%\r\n", pm2);
Serial.printf("Temepratura = %.3f bar\r\n", temperatura);
Serial.printf("VlaĹľnost = %.1f m/s\r\n", vlaga);
 
display.setCursor(0, 24);
display.printf("PM 2,5: %5.2f C\r\n", pm1);
display.printf("PM 10 : %d %%\r\n", pm2);
display.printf("Temperatura : %.3fbar\r\n", temperatura);
display.printf("Relativna vlaĹľnost : %.1f m/s\r\n", vlaga);
display.drawRect(97, 56, 3, 3, WHITE);
display.display();
 
}
 
http.end(); //Close connection
 
}
 
delay(60000); // wait 1 minute
 
}
// End of code.

Hi, im almost done with these.
But today I added SHT30 to my wemos and I have nov 2 json files, how can I have just one, with temp and humity?

Thanks

What do you mean with 2 json ? When you call the API ?
Send me the json you have

HI, system creates 2 sensor ID, so I just pull data from on on my wemos
one is 70977 for PM2,5 and 10, ad 70978 for SHT30.

OK I understand. I have never tried to put 2 TRHP sensors. Actually you can t change this. You have to merge in your code or show just 1

Thx, I got it to work.
I will post my dirty code soon here.

1 Like

I have just seen you run the loop once every minute. The data are updated every 5 minutes. Please increase to avoid API overload. Will you put the code in a GitHub ?

1 Like

I pull data once, than I use for loop to run it 10x in loop.
I can incrasse that to 20x times.

Or 4min is OK.

Yes I will, is very “dirty” need some polishing.

Yes 4 minutes would be better.

Done.
I also post regarding not able to add second sensor, can U help me in that way?

Unfortunately not. @ricki-z has to do it.

OK, Thank U anyway.
I also send email to tech@

@divfili SHT30 should be added now.