The prototype
The prototype is ready, this is the picture:
The LED will light if temperature in sensor 2 goes above a set limit. You can also switch on and off the led from the fonera, sending an I or an X :
root@OpenWrt:/usr/bin# echo I > /dev/ttyS0
The Fonera is the 2200 version, I installed openwrt kamikaze:
root@OpenWrt:~# uname -a Linux OpenWrt 2.6.26.5 #21 Sat Feb 14 23:12:28 CET 2009 mips unknown
The serial connection was giving me trouble, as openwrt uses the only Fonera serial port for console, so the login prompt was interfering Finally found how to disable the login prompt at the serial console:
root@OpenWrt:~# cat /etc/inittab
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K stop
tts/0::askfirst:/bin/ash --login
# disable login in console to release serial port
#ttyS0::askfirst:/bin/ash --login
tty1::askfirst:/bin/ash --login
and this is the Arduino program.
This is how the output looks:
root@OpenWrt:/usr/bin# cat /dev/ttyS0
1 temp_c=22.00
2 temp_c=22.00
Led OFF
1 temp_c=22.00
2 temp_c=22.00
Led OFF
This is how the output looks:
root@OpenWrt:/usr/bin# cat /dev/ttyS0
1 temp_c=22.00
2 temp_c=22.00
Led OFF
1 temp_c=22.00
2 temp_c=22.00
Led OFF
The LED will light if temperature in sensor 2 goes above a set limit. You can also switch on and off the led from the fonera, sending an I or an X :
root@OpenWrt:/usr/bin# echo I > /dev/ttyS0
The Fonera is the 2200 version, I installed openwrt kamikaze:
root@OpenWrt:~# uname -a Linux OpenWrt 2.6.26.5 #21 Sat Feb 14 23:12:28 CET 2009 mips unknown
The serial connection was giving me trouble, as openwrt uses the only Fonera serial port for console, so the login prompt was interfering Finally found how to disable the login prompt at the serial console:
root@OpenWrt:~# cat /etc/inittab
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K stop
tts/0::askfirst:/bin/ash --login
# disable login in console to release serial port
#ttyS0::askfirst:/bin/ash --login
tty1::askfirst:/bin/ash --login
Comments
Post a Comment