Well,

I made some progress on this.

I'd not yet used an arduino, programmed an avr or an xbee and got this 
up in an evening and an afternoon. This is still not technically 
relevant for the listserv as it's not on owfs, but if there is a way to 
do that I'm game.

I used the following:
Rpi, Raspbian, python 2.7, python-serial
3.3V trinket from Adafruit (ATTiny85 with bootloader, USB adapter and 
USBTinyISP, uses Arduino IDE)
Parallax XBee USB adapter (Bridge for digi's XCTU to program)
Parallax XBee breakout
DS18B20

I turned off the built-in console serial via /boot/cmdline.txt and 
/etc/inittab on the pi and installed pyserial
Wrote a really simple script to continuously read from ttyAMA0

I used SoftwareSerial and OneWire libraries to create a basic sketch 
that polls the io on the ATTiny85 for OneWire devices and sends the 
results to one of the io pins as 9600baud serial. Uploaded the sketch 
using the Trinket bootloader.

Installed parallax USB drivers and XCTU software for programming the 
XBees. The new interface is super easy to to use and very nice. Set up 
one of the units as a coordinator and one as a router.

Connected the coordinator's digital out pin to RX on the Pi.
Connected the xbee router's digital in pin to the serial out on the 
Trinket (ATTiny85).
On the DS18B20, I connected ground to ground, Vcc to 3.3V from the 
trinket, and data to the assigned OneWire input pin on the ATTiny85. 
4.7k pullup between data and Vcc.

In the end I ran the python script on the Pi and was greeted by periodic 
notification of DS18B20 ROM. I did not poll temperatures, as the 
DallasTemperature library resulted in my sketch being about 2kb too 
large for the ATTiny85. Looks like I'll have to upgrade to a mega.

Having one of the USB programmers around for the XBees will be pretty 
handy for deployment. Too bad the ATTiny85 is too small or I could use a 
similar strategy. No sweat, I'll design a board with a DIP slot for the 
mega and get a USBTinyISP programmer.

Happy hacking.
Colin


On 1/2/2014 18:43, Pedro Côrte-Real wrote:
> On Fri, Jan 3, 2014 at 1:02 AM, Colin Reese <[email protected]> wrote:
>> Good info. I'm not sure why it should choke on that. There are examples of 
>> sqlite for huge implementations, but I'd probably journal a log long before 
>> it got to that size.
>
> If I remember correctly it didn't choke on the writing itself. It's
> just that I need to do efficient date range queries to build the
> charts and it got progressively slower as I had more data. Mysql
> itself has gotten slower as the data piles up and eventually I'll have
> to do some caching instead of relying on the database to be fast on
> its own.
>
>> I'm fine with only one writer, and besides the database only locks for a few 
>> ms when that happens.
>>
>> I prefer the small, light, and fast on a modestly powered device like the 
>> RPi, and it's an easy port to MySQL if I decide to go that route at some 
>> point.
>
> Right, that's why I regret not using ActiveRecord on the last rewrite.
> I considered it and thought I was overengineering things but it would
> be nice to have that flexibility now.
>
>> Colin
>>
>> P.S. Many would take offense to saying sqlite is not a 'real' database. It's 
>> just a different model. It all depends on what you need.
>
> :) right, but I guess you know what I meant
>
> ------------------------------------------------------------------------------
> Rapidly troubleshoot problems before they affect your business. Most IT
> organizations don't have a clear picture of how application performance
> affects their revenue. With AppDynamics, you get 100% visibility into your
> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
> http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
> _______________________________________________
> Owfs-developers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/owfs-developers
>

------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Owfs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to