I would appreciate a few more pointers on installing Python and the Wattcher-final.py to the Asus Router...
I've been working on the Tweet-a-Watt project for the past couple of evenings and have reached the point where I need to install Python and a few other items onto the Asus Router. (I've completed mightohm's radio project to the point where the opkg kmod-usb-core has been installed)
The usb-core doesn't seem to give me access to the USB thumb drive... Are other files needed?
Do I install Python onto the USB drive? (Seems the router wont meet the mem requirements)
Any assistance would be greatly appreciated.
Last steps to Twwet-a-Watt>Expand>Remove the Computer ?
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
-
- Posts: 2
- Joined: Sun Jun 21, 2009 11:43 pm
-
- Posts: 12151
- Joined: Thu Apr 06, 2006 4:21 pm
Re: Last steps to Twwet-a-Watt>Expand>Remove the Computer ?
ya you have to install python on the usb key
i have smoe handwritten notes that say:
change opkg.conf to jffs
add kmod-usbsotrage kmod-usb-ochi
add usb 2 opkg.conf
edit /etc/profile
mv libs for symlinking
install pyserial
then its just adding python libs
i have smoe handwritten notes that say:
change opkg.conf to jffs
add kmod-usbsotrage kmod-usb-ochi
add usb 2 opkg.conf
edit /etc/profile
mv libs for symlinking
install pyserial
then its just adding python libs
-
- Posts: 6
- Joined: Wed Aug 05, 2009 1:30 am
Re: Last steps to Twwet-a-Watt>Expand>Remove the Computer ?
Hi.
Okay. I have a Asus WL500GPV.2 running DD-WRT v24-sp2 (07/22/09) mega
(SVN revision 12548M NEWD Eko) and have installed:
usb support (native in the above build - check the wiki)
optware support (Installing this made installing the rest a snap)
python25 - 2.5.1-2
py25-simplejson - 1.7.3-1
py25-serial - 2.2-4
setserial
Had a bit of trouble with the serial port but figured it out.
to see your serial ports are being recognized...
dmesg | grep tty
which gave me:
Kernel command line: root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200
ttyS00 at 0xb8000300 (irq = 3) is a 16550A
ttyS01 at 0xb8000400 (irq = 3) is a 16550A
ls -l /dev/tts/*
crw------- 1 root root 4, 64 Jan 1 00:00 /dev/tts/0
crw------- 1 root root 4, 65 Jan 1 00:00 /dev/tts/1
using setserial -g -a gave me more info
root@DD-WRT:/opt/bin/wattcher#setserial -g -a /dev/tts/0
/dev/tts/0, Line 0, UART: 16550A, Port: 0x0000, IRQ: 3
Baud_base: 1562500, close_delay: 50, divisor: 0
closing_wait: 3000
Flags: spd_normal
Kept getting the cannot open port error - then realized I had "SERIALPORT = "dev/tts/0"
Was referring to dev/tts/0 instead of /dev/tts/0. DOH! what can i say - im a linux newb
Next step, sleepy time, and tomorrow connect the xbee. woohoo!
Okay. I have a Asus WL500GPV.2 running DD-WRT v24-sp2 (07/22/09) mega
(SVN revision 12548M NEWD Eko) and have installed:
usb support (native in the above build - check the wiki)
optware support (Installing this made installing the rest a snap)
python25 - 2.5.1-2
py25-simplejson - 1.7.3-1
py25-serial - 2.2-4
setserial
Had a bit of trouble with the serial port but figured it out.
to see your serial ports are being recognized...
dmesg | grep tty
which gave me:
Kernel command line: root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200
ttyS00 at 0xb8000300 (irq = 3) is a 16550A
ttyS01 at 0xb8000400 (irq = 3) is a 16550A
ls -l /dev/tts/*
crw------- 1 root root 4, 64 Jan 1 00:00 /dev/tts/0
crw------- 1 root root 4, 65 Jan 1 00:00 /dev/tts/1
using setserial -g -a gave me more info
root@DD-WRT:/opt/bin/wattcher#setserial -g -a /dev/tts/0
/dev/tts/0, Line 0, UART: 16550A, Port: 0x0000, IRQ: 3
Baud_base: 1562500, close_delay: 50, divisor: 0
closing_wait: 3000
Flags: spd_normal
Kept getting the cannot open port error - then realized I had "SERIALPORT = "dev/tts/0"
Was referring to dev/tts/0 instead of /dev/tts/0. DOH! what can i say - im a linux newb
Next step, sleepy time, and tomorrow connect the xbee. woohoo!
-
- Posts: 12151
- Joined: Thu Apr 06, 2006 4:21 pm
Re: Last steps to Twwet-a-Watt>Expand>Remove the Computer ?
congrats! I think you're done with the hard part
-
- Posts: 6
- Joined: Wed Aug 05, 2009 1:30 am
Re: Last steps to Twwet-a-Watt>Expand>Remove the Computer ?
Arg! I spoke to soon.
I am having trouble getting data in on the Serial port /dev/tts/0.
To test- I ran a terminal to that port via my TTL cable - and can see boot information (at the default of 115200) - however I can not login or pass any info via that telnet session.
I can do a cp somefile.txt /dev/tts/0 and see most of the output of the file (it will stop without displaying the whole file)
I thought I should be able to input data via the serial connection eg, login to dd-wrt and not just take it as output) I have not been able to login via the terminal serial on either of my two asus routers (wl500gpv2 or wl520)... should i be able to?
Any thoughts on how i might resolve?
I am having trouble getting data in on the Serial port /dev/tts/0.
To test- I ran a terminal to that port via my TTL cable - and can see boot information (at the default of 115200) - however I can not login or pass any info via that telnet session.
I can do a cp somefile.txt /dev/tts/0 and see most of the output of the file (it will stop without displaying the whole file)
I thought I should be able to input data via the serial connection eg, login to dd-wrt and not just take it as output) I have not been able to login via the terminal serial on either of my two asus routers (wl500gpv2 or wl520)... should i be able to?
Any thoughts on how i might resolve?
-
- Posts: 12151
- Joined: Thu Apr 06, 2006 4:21 pm
Re: Last steps to Twwet-a-Watt>Expand>Remove the Computer ?
dunno, you may want to post up in router hacking forums...theres probably tutorials/walkthrus/faq's on the topic
-
- Posts: 6
- Joined: Wed Aug 05, 2009 1:30 am
Re: Last steps to Twwet-a-Watt>Expand>Remove the Computer ?
Ok. Change of plan.
I think the problem that I have (had) was that the tts0 was being used as a console, and even tho it looked like i could open it - it wasnt opened for read (just write) (can you verify you were using tts0 for your mod - and that tts0 was also used as a console?
Instead, I added support for serial usb.
you can get the modules here in this thread http://www.dd-wrt.com/phpBB2/viewtopic. ... sc&start=0
What I wound up doing was adding kernel modules
usbserial.o and ftdi_sio.o
using (order is important)
insmod /opt/usb/serial/usbserial.o
insmod /opt/usb/serial/ftdi_sio.o
setserial to set baud rate to 9600
setserial /dev/usb/tts/0 baud_base 9600
then used /dev/usb/tts/0 instead of /dev/tts/0.
viola! all was working!
Only problem - now I need to find a second serial port. I'd like to add a serial LCD to show current usage (and display the many other sensors I am planning on adding
I think the problem that I have (had) was that the tts0 was being used as a console, and even tho it looked like i could open it - it wasnt opened for read (just write) (can you verify you were using tts0 for your mod - and that tts0 was also used as a console?
Instead, I added support for serial usb.
you can get the modules here in this thread http://www.dd-wrt.com/phpBB2/viewtopic. ... sc&start=0
What I wound up doing was adding kernel modules
usbserial.o and ftdi_sio.o
using (order is important)
insmod /opt/usb/serial/usbserial.o
insmod /opt/usb/serial/ftdi_sio.o
setserial to set baud rate to 9600
setserial /dev/usb/tts/0 baud_base 9600
then used /dev/usb/tts/0 instead of /dev/tts/0.
viola! all was working!
Only problem - now I need to find a second serial port. I'd like to add a serial LCD to show current usage (and display the many other sensors I am planning on adding
- richms
- Posts: 558
- Joined: Tue Jan 20, 2009 3:05 am
Re: Last steps to Twwet-a-Watt>Expand>Remove the Computer ?
USB to serial works fine on the asus 520gu - there are a couple of things to install thru opkg - one is USBserial, the other is for FTDI or PL2303 or whatever your USB to serial is. I have arduinos on the router at the moment for something else I am messing with, and I tried the 3.3v nokia data cable as well and that operated fine (into the console of another router since I had a header soldered on the other end of it)
I really wish the guys at asus would have bought out the second serial and USB to some empty headers - that would make it even more awesome. As it is I have just gutted a hub and doublesided taped it to an empty part of the board - so the onboard USB is replaced with a chopped extension cable hanging out the back where I desoldered the PCB socket from.
I really wish the guys at asus would have bought out the second serial and USB to some empty headers - that would make it even more awesome. As it is I have just gutted a hub and doublesided taped it to an empty part of the board - so the onboard USB is replaced with a chopped extension cable hanging out the back where I desoldered the PCB socket from.
Please be positive and constructive with your questions and comments.