Page 1 of 1

Show signs of life on ssd1306

Posted: Sun Aug 18, 2019 10:19 am
by fencer
Hello, So I've been working on a headless project for some time and got a ssd1306 display connected via I2C which is displaying information via python code.
Since this is a headless implementation I would need to show signs of life on the LCD, anything will do as long as the user knows that the PI is powered up. IE this has to happen as soon as the power button is pressed. I've read about using and i2c display as a primary display but this is not really what I need since I want to show only relevant information controlled via my custom script.

Any pointers to how I can achieve this?

Re: Show signs of life on ssd1306

Posted: Sun Aug 18, 2019 9:51 pm
by joan
What do you mean by signs of life? I doubt you can write to the screen much earlier than your script starts running.

Re: Show signs of life on ssd1306

Posted: Sun Aug 18, 2019 9:57 pm
by Andyroo
My first thought was to add a LED to the board connected to the power pins :roll:

What device is the O/S on and is it loading the GUI? You are be able to shave some time off this by putting a blank SD card in if you are using an external (USB) drive.

There is a command line tool i2cset that lets you write but I’ve no idea how it works! Maybe you can call this early in the Linux boot sequence. See here from 2015 for an example.


I’m not sure if rc.local or systemd would help to use i2cset - hooking in via the kernel driver maybe the earliest you can get BUT where you go modding i2c-dev is way beyond me :oops:

Re: Show signs of life on ssd1306

Posted: Mon Aug 19, 2019 9:45 am
by hippy
You could use a separate microcontroller and parallel its I2C bus with the Pi's.

The micro will start immediately power is supplied, can initialise the SSD1306, display a "Booting" message and animate the display until the Pi is ready to take over.

When the Pi is ready to take over, it can signal the micro, tell it to relinquish its control of the I2C Bus and then take over once it has.

Code: Select all

.------------.              .----------------.
|        SDA |------.------>| SDA    SSD1306 |
| Pi     SCL |------|---.-->| SCL    Display |
|        RDY |---.  |   |   `----------------'
`------------'   |  |   |
.------------.   |  |   |
|        RUN |<--'  |   |
| Micro  SDA |------'   |
|        SCL |----------'
`------------'
You don't strictly need to signal the micro, can avoid RDY/RUN, by having the micro automatically relinquish control after some time while ensuring the Pi doesn't take control of the I2C bus until after that time has elapsed.

Alternatively the Pi could determine the micro has relinquished control by monitoring the SCL signal for activity.