Posts: 1
Joined: Thu Jan 24, 2019 4:03 pm

Show signs of life on ssd1306

Sun Aug 18, 2019 10:19 am

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?

User avatar
Posts: 14375
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Show signs of life on ssd1306

Sun Aug 18, 2019 9:51 pm

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

Sun Aug 18, 2019 9:57 pm

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:

Posts: 6104
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Show signs of life on ssd1306

Mon Aug 19, 2019 9:45 am

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.

Return to “Interfacing (DSI, CSI, I2C, etc.)”