Forum 2005-2010 (read only)
(Read 9361 times)
Dec 30, 2009, 11:45 pm
We´re working in a project
: "Electronic Rapid Prototype Hardware".
The main idea is to have an ECU to be able to be very quick in a prototype phase of a project.
At the moment we´re working joining a linksys router (or similar) + Arduino Mega + specific hardware to have rs485,can bus,...
We try work as easy as possible (DD-WRT, shell script,...). For sure, there are better methods (openwrt, cross-compiler,...), but it requires high skills.
Telemetry system in Excel:
Using Linkduino as Telemetry System (own software):
Control from Twitter:
Embedded Web server:
You can find all the information about Linkduino in
. Sorry, it´s in spanish (maybe google traductor can help)
Jan 04, 2010, 09:33 am
Another example, this time how to control a LCD from internet/lan:
Jan 04, 2010, 09:28 pm
Igor, this is awesome!
I made a similar setup using a Fonera (Fon2100) router running OpenWRT that talks serial to the Arduino. It works just fine connected directly.
I just wish there were some very small and cheap routers for all this that could be standardized on or sold as some bare-bones kits.
Jan 04, 2010, 10:11 pm
: Jan 04, 2010, 10:17 pm by igorreal
Thank-u!! I´m doing the same as you (not directly because is 3v3). At the moment, I´m triying only with DD-WRT, in stead of OpenWRT, because it has an easy configuration web page.
I also try to do the router programmation using bash scripting.
The idea is to have a "generic hardware" for the prototype phase of an electronic project (always trying the easy way to resolve things).
What have you done with arduino+Fon?
Jan 05, 2010, 05:56 pm
The Arduino (or ATMega168 chip) seems to accept 3.3v TTL serial signals just fine and the FON router I'm using reads Arduino's 5v signals just fine too. I haven't noticed any problems using both directly but it's probably better to have a proper converter like in your circuit.
I'm using OpenWRT and the ATMega168 with Arduino firmware to monitor and control a hydroponics setup for growing plants. My code is here: http://github.com/nemik/arduinoponics
I initially tried to use DD-WRT but found OpenWRT to be much easier to use and modify, plus very lightweight. Their LuCi web-admin pages are powered by a Lua-based MVC framework that I found very easy to extend. Plus Lua is very lightweight and I use it as a 'daemon' script to send and receive over serial from the Arduino. I have some pictures of it here too: http://www.flickr.com/photos/nemik/sets/72157622608195083/
The software is pretty hackish and very specific to my needs though. Something more generic like Firmata would be more appropriate for a general prototyping solution.
Jan 05, 2010, 06:22 pm
: Jan 05, 2010, 06:24 pm by igorreal
It would be fantastic if you explain a how-to tutorial!! Maybe it´s a specific application, but it helps to other people....(always it's good learn how other people have resolved their projects).
Jan 05, 2010, 10:14 pm
There is still a long way to go in terms of documentation for the project; like drawing a schematic, BOM, etc.
I'm planning on creating another hydroponics setup using Deep Water Culture and an air pump for the roots, so I'll try to document that as I go along.
Jan 05, 2010, 10:47 pm
There are a lot of people working with linux based routers, but not info...
People, as me, who are not familiar with linux, is not easy to start with it. And all information around openwrt,x-wrt, luci,... are quite confused.
Jan 05, 2010, 11:16 pm
I'd seriously recommend starting with OpenWRT since their systems seem very organized and easier to modify than DD-WRT.
If you want examples from my code, just pretend the openwrt stuff is in /
So the etc directory and everything inside it would be like '/etc/' on the filesystem for OpenWRT.
My startup scripts that get run when the system boots up for setting up serial and the daemon for talking with the Arduino are in /etc/init.d/ for example.
Plus the aptitude-like opkg package management system on OpenWRT is very awesome. You get a minimally but perfectly functional system and then add on whatever else you might need, or strip some things away.
Jan 06, 2010, 02:51 pm
: Jan 06, 2010, 02:53 pm by igorreal
I´d like to have a firmware with:
1) Advanced bash commands (wget with post, curl, ....). Because with it I could use Pachube, change twitter status, mail,...
2) Web interface to configure it (like Tomato,Gargoyle,Luci,...)
3) I should be able to use the serial port
4) Web server compatible with cgi scripts
5) Send the firmware as dd-wrt, with a *.bin file or similar
Because using bash scripts is something "universal" and with documentation. It should be "easy to do".
Is it possible?
Thank-u for the information.
Jan 06, 2010, 06:27 pm
1) I'm using a bash script with curl to send updates of temperature and light readings to Pachube, it is working nicely. Cron'd to go off every minute. Curl was installed via the OPKG package management system that comes with OpenWRT and they had curl (as well as many other common utils) in their repository.
2) LuCi is pretty great and easy to modify. I found the Lua language to be very intuitive.
3) That's working fine for me. I had to get a binary of the 'stty' program to configure the serial port to the correct baud rate for the Arduino. Once that was done and the default serial console in OpenWRT was disabled, everything worked great. I can even `tail` read serial /dev/ttys0 port and `cat` or `echo` data to it which the Arduino receives fine too.
4) LuCi runs on top of CGI so that works as well. Not sure what language you prefer to do this with, but I think the OpenWRT's team's decision to go with Lua is excellent. It is a fast language with a very small run-time executable, very good performance and still has many libraries. It is also very easy to extend and write lower-level C code to interact with it, should you ever need such advanced functionality.
Others like Python and Perl are wayyy too heavy-weight for use in a device with as little memory as a Fon2100 and even then they need certain things stripped out of the language for them to even fit on the router. I don't even want to think about something like Ruby on there.
5) The changes you make to the OS and firmware can be packaged as a .bin, that's fine. OpenWRT has a great toolchain to enable such custom builds. I plan on trying that out sometime but from some reading it doesn't seem to be too bad at all.
Even better (IMO) is starting with a default OpenWRT package and then packaging your code as an OPKG package that can be added to some repository. That way it could be updated easily later without having to re-install the entire firmware when you want to add updates and new features. The opkg package management system can take care of such things very easily for you.
Also, plain old bash scripting is pretty universal, but IMO a pain to program in. I'm not a big fan of bash. I'd much rather use a higher-level language and Lua on an embedded device fits that requirement perfectly being very lightweight and still having excellent performance.
Jan 06, 2010, 07:30 pm
: Jan 06, 2010, 07:38 pm by igorreal
Thanks for encouraging me....I´m tinkering with it.
My first step has been install Gargoyle package (kamikaze 8.09.1 + graphical enviorment). It´s working good and it was easy with the *.bin archive (as dd-wrt).
What do you think about it? It´s very easy to use....
I´m not idea about linux...Maybe some of my doubt are very basic, but I´m a rookie....
I´ve achieve install curl.... ooooeee!!!!. I´m not sure how, but now it´s working
I had a problem, because when I tried
opkg install curl
, the answer was :
Only have 760 available blocks on filesystem /, pkg libopenssl needs 1270
I´ve search about it, and I´ve added to /etc/opkg.conf:
How I know my free space to install packages?
After the change, I´ve tested again and.....
curl -u real2electronic:
-d status="Thank-u nemik! Sended from:LINKDUINO" http://twitter.com/statuses/update.xml
And.... it works!!!! he,he,he (You can see => http://twitter.com/real2electronic)
Jan 06, 2010, 07:53 pm
Igor, nice! Glad you like it.
I have never heard of Gargoyle, it seems like a pretty cool interface and intuitive for end users, but not sure it's as easy to use as LuCi to extend it as a developer. Seems like it uses some native C/C++ utilities to generate HTML files from the config files in /etc/ whereas LuCi is more of a web MVC framework based on Lua (with Models, Views and Controllers). The MVC architecture for me is fairly intuitive and nice to work with, though I'm sure the performance isn't as good as with Gargoyle.
Which device are you trying to install on? A WRT54G router? curl does require libopenssl to make SSL connections, but not sure why your space is so low? Your router should even have more memory than the tiny Fonera I'm using and i got both on there just fine...
To see how much space you have, you can run the `df` command and it'll show the total, used and available space on each partition. You can also run it as `df -h` to show the sized in human-readable format (KB, MB, GB, etc versus just number of bytes).
One warning though, the filesystem is based on jffs2 which I found to be pretty fragile sometimes. Doing an opkg install once screwed up everything for me, to the point where the filesystem wouldn't mount, so it reverted to a read-only one that gets reset every time you reset the router. I made a blog post here on how I eventually recovered my data (didn't save my code at that point, lesson learned). The post is here: http://blog.nemik.net/2009/11/fixing-broken-jffs2-partition/
So I would really not recommend forcing the install of the package if it doesn't fit, you might have to start over if the JFFS2 partition decides to choke; I'm not sure how it handles becoming completely full.
It is better to perhaps see why you have so little space and see if you can remove some packages you might not need. OpenWRT on its own is pretty lightweight, perhaps Gargoyle takes up a lot of space? I'm not sure. Either way, it is surprising that it actually worked! I would just not recommend doing that in the future.
Jan 06, 2010, 08:32 pm
I think you have 8Mb of flash and my router only 4Mb (WRT54GL).
root@OpenWrt:/jffs/usr/bin# df -h
Filesystem Size Used Available Use% Mounted on
rootfs 2.1M 2.1M 0 100% /
/dev/root 2.1M 2.1M 0 100% /rom
tmpfs 7.0M 60.0k 6.9M 1% /tmp
/dev/mtdblock/4 1.2M 1.1M 92.0k 92% /jffs
mini_fo:/jffs 2.1M 2.1M 0 100% /
I´ve to read and search in internet all the info you post here...
I´ll keep you updated.
Jan 09, 2010, 05:40 pm
: Jan 09, 2010, 05:42 pm by igorreal
I´ve just received the SD Sniffer board from Sparkfun and I´ve working the SD hack for the router.
I´ve achieve work with DD-WRT and an old 1 Gb SD card.
There is a Tomato firmware which has a driver for moderm SDHC (I´ve tested 4 Gb), but I don´t know yet if I can use Optware with this firmware.
May I install with opkg a package for using sd/mmc HC with Kamikaze?
Because the problem of DD-WRT is that only work old SD...
root@ARDUINO:/jffs/opt/bin# df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 2.8M 2.8M 0 100% /
/dev/mmc/disc0/part1 960.7M 5.9M 906.0M 1% /mmc
/dev/mmc/disc0/part1 960.7M 5.9M 906.0M 1% /jffs
/dev/mmc/disc0/part1 960.7M 5.9M 906.0M 1% /opt