Bryan Mayland
TVWBB Hall of Fame
Well avrdude supports SPI transfers via a bitbang interface, but not any Linux spidev interface that I know of. The source I am looking at is avrdude 5.8 though so maybe they've worked it out since then. The source is so generic and config file driven that it can be hard to follow, and the AVR SPI protocol is so dead simple that it was easiest to just implement it myself. I'm sure the reason everyone is using FTDI cables is probably because the default kernel spits out logging on UART0 and I think it may put a getty on it too. Also most people think Arduinos are all 5V, so it is probably for the best that they don't try to hook a 5V arduino to a 3.3V Pi.
There's other data coming out too besides the HMSU sentence every 2 seconds-- configuration data exchange, rf probe statuses, etc. It still isn't much data and 19200 baud is fine. The high baud rate was just to work around various limitations of the platforms, which is funny that now I'm lowering the baud rate to get around the limitations of this new high-performance platform! I checked the Arduino HardwareSerial source code too and thank jeebus it blocks if the serial buffer is full (albeit with a comment that says "???: Should we just return 0" NO!) so there shouldn't be any problem losing information when linkmeterd does its big config query on startup.
I used to update every second back in the very first version of HeaterMeter but when I looked at trying to write a log, first with a connected SPI dataflash chip, then with an XBee transmitter to a logging machine, it became clear that nothing really happens in a second. I was looking toward moving to the Linksys platform, which might only have RAM as storage. A full 1 second log file with all the probes plugged in was like 250kB per hour (moving averages used to also be sent) and we certainly wouldn't have room for more than an hour or two of that.
I picked an RRD file as the storage mechanism and came up with some intervals that made full resolution graphs for the amount of time that BBQs take. The entire storage is 77kB and holds up to 24 hours of data at the largest time slice. You can't update an RRD more than once per second, and if you try to do it every second sometimes you'll end up trying to update in the same second and RRD gets all mad. Given the slow response time of what we're trying to control, I can't see where more frequent updates would be of any use anyway.
The Pi doesn't have a RTC but it does keep time just fine. When the network starts an ntpd syncs the clock to GMT and linkmeterd notices the time skip and recreates the RRD with the new time. The times displayed on the website are adjusted for local time in the browser.
There's other data coming out too besides the HMSU sentence every 2 seconds-- configuration data exchange, rf probe statuses, etc. It still isn't much data and 19200 baud is fine. The high baud rate was just to work around various limitations of the platforms, which is funny that now I'm lowering the baud rate to get around the limitations of this new high-performance platform! I checked the Arduino HardwareSerial source code too and thank jeebus it blocks if the serial buffer is full (albeit with a comment that says "???: Should we just return 0" NO!) so there shouldn't be any problem losing information when linkmeterd does its big config query on startup.
I used to update every second back in the very first version of HeaterMeter but when I looked at trying to write a log, first with a connected SPI dataflash chip, then with an XBee transmitter to a logging machine, it became clear that nothing really happens in a second. I was looking toward moving to the Linksys platform, which might only have RAM as storage. A full 1 second log file with all the probes plugged in was like 250kB per hour (moving averages used to also be sent) and we certainly wouldn't have room for more than an hour or two of that.
I picked an RRD file as the storage mechanism and came up with some intervals that made full resolution graphs for the amount of time that BBQs take. The entire storage is 77kB and holds up to 24 hours of data at the largest time slice. You can't update an RRD more than once per second, and if you try to do it every second sometimes you'll end up trying to update in the same second and RRD gets all mad. Given the slow response time of what we're trying to control, I can't see where more frequent updates would be of any use anyway.
The Pi doesn't have a RTC but it does keep time just fine. When the network starts an ntpd syncs the clock to GMT and linkmeterd notices the time skip and recreates the RRD with the new time. The times displayed on the website are adjusted for local time in the browser.