Intro
Very occasionally I have connectivity problems at home and it can be hard to work out where the problem lies.
If I cant view a webpage from my PC, is the PC misbhaving or the router or a website?
If I cant play music, is my music server misbehaving, is the hifi off line or is wifi not available?
C3-OLED is a tiny board measuring 3cm x 2cm. In addition to ESP32 wifi it has a little (72x40 pixel) OLED screen.
Since C3-OLED can work independently of any other hardware it can test connectivity by pinging other systems and display abbreviated results on the screen.
Design
This first version is simple; it connects to wifi then pings my home (always on) Raspberry Pi servers and finally checks that my websites on the internet are accessible.
At each stage it prints brief results.
Software
Programming is straightforward.
I use the standard Arduino ESP32 wifi library and example wifi connection sketch.
I use a simple library ESP32Ping for connectivity tests.
The C3-OLED uses a library called U8g2 and the ebay vendor (Brightsparks) kindly provided a working sample OLED sketch.
I combine three example sketches to:
* connect to wifi and show the assigned IP address
* ping local servers and show how many were accessible
* ping internet sites and show how many were accessible
The OLED screen (72 x 40 pixels) is small to be readable I can display about 8 characters each row in 3 rows. This is fine for basic info.
More detailed messages are output on a serial port. If C3-OLED is attached to a PC they can be viewed through Arduino IDE or Putty.
More detailed messages are output on a serial port. If C3-OLED is attached to a PC they can be viewed through Arduino IDE or Putty.
It is convenient that I can use C3-OLED anywhere, it can be plugged in to any USB wall socket, or could even be attached to a battery pack.
The monitor program works well. It runs for about 30s and tells me whether my network is ok. I can then use PC or Home Assistant for further checks and diagnosis.
Enhancements
There is a lot of scope for enhancements, if I think it is worthwhile:
1) Add a results web page so that I could use a browser on phone, iPad or PC to look at details
2) Run periodically, say once an hour a put in deep sleep in between if there are no issues. This could be useful if I can send a message somehow (whatsapp, text, email, mqtt, etc) when a problem is detected.
3) 3D print a case to contain C3-OLED safely
4) Check status of more systems such as TV, hifi etc which are normally turned on.
No comments:
Post a Comment