I would like to display the usual electrical values on a SPI LCD display, type Nokia 3310, connected to a Raspi.There is as well a RFM69Pi connected to the Raspi.
I know there is a SPI library written for Python. One of the possible solution is to take the emonhub_interfacer.py file and put some code in there because I think this file is already logging frames to the emonhub log file.
What do you think? Will that work?
Thanks
Walter
Re: Raspberry Pi and SPI LCD display
This is probably a question for Paul (pb66), the developer of the python scripts for the emonhub module.
Thanks
Walter
Re: Raspberry Pi and SPI LCD display
Hi Walter, I'm not so sure I can help you much. Having no experience with either SPI or LCD means it isn't looking good for any useful help. When I first read you post I was going to attached a link to Glyn's recent work for the LCD display on the emonPi, but then I recalled that was I²C not SPI.
The only pointer's that spring to mind right now are that IF looking to integrate this with emonHub in it's current form a custom reporter maybe marginally easier to send a stream of data frames. Before investing too much time or effort into integrating this functionality you should develop the (probably) code to communicate with and populate the display from a frame of values. Then tackle getting the values from emonhub to that script as I think you will want to have some sort of filtering and/or labeling of data.
The ability to stream data frames from emonhub to a display via SPI or I²C would be a great addition but is currently difficult due to emonhubs "send all to each" structure and the in ability to read from emoncms calculated feeds out of the box. This will change (hopefully soon'ish) and then certain data can be included or excluded to form a "custom channel" for the display.
In the interim the method of communication and interface to the display can still be designed and then be reused when the time comes.
An alternative method to supply data to your new display interface could be to just "fetch" feed data from emoncms. The "fetch" api allows you to define a list of feeds to get the current value of. This has the advantage of giving the new script the control of what data and how often, as well as packaging it up into a single frame of a set structure per update so collation and naming is no longer a problem. This would closely mimic how emonhub could eventually tackle the same task.
Paul
Re: Raspberry Pi and SPI LCD display
Hello Paul
Thanks a lot for your detailed information. That helps me a lot.
Some time ago, you posted in this forum a python test script you use to simulate frames uploads to emoncms. I took that file and added a function to generate random numbers for power, etc. I installed the service and the other .py scripts from GitHub. So, now I have a working system to upload some stuff to emoncms.
I have also found the python SPI library on the Adafruit Web site. I should be able to combine these modules and simulate data for posting to emoncms and display them on the LCD. Let's see...
Thanks again
Walter