OpenBridge development

steliosm

Senior Member
Hello all.

I started a new project to try to fill in the gap between PicAxe microcontrollers and the Internet. We have used several techniques in the past to send data to the Internet or to share data with web browsers. Those techniques involved serial connection to computers, serial connections to openwrt enabled wifi/adsl routers, network modules such as the simplelan and maybe siteplayer. All of them worked but offered limited capabilities for expansion.

My aim is to create a network module that will act as a bridge between the PicAxe and the Internet. It will also be able to support new features, such as sending data to specific social sites, retrieving and parsing data from specific sites (e.g. weather data) very easily. I've done a lot of experimenting and I've chosen an embedded linux solution as the core of the module.

I really liked the SimpleLan module and the way it worked. In this project I'm replicating the communication protocol and also enhancing the functionalities. The PicAxe will communicate with the module over a serial connection. It will send a command with all the necessary data and then it will send a request to read the results.

Up to this point the module is able to:
- make HTTP requests using the GET method, e.g. http://my.telemetry.data.com?data=123
- make a twitter update
- make a pachube update

My plans are to also support:
- sending email
- sending sms through an SMS gateway
- reading twitter data
- reading pachube feed data
- reading RSS/XML data
- web server for displaying/setting data
- make tcp connection to server

The development is based on the bifferboard embedded device using embedded linux and Lua.
Any help on the hardware part or the software part is welcomed.
 

lbenson

Senior Member
Stelios--I downloaded the openbridge files you referenced in the other thread, and tried to set up on a Dockstar running Debian Squeeze. I have installed lua and luasocket. I have a picaxe program which will send test strings which I think openbridge should respond to. The Dockstar is properly receiving serial i/o from the picaxe.

When I run "lua memcached &", I get the following message:
[1] 10941
root@dock82:/home/user0/openbridge# lua: memcached:11: unexpected symbol near `...'

I think I'm missing some parts of the setup. Can you describe what is needed to prepare the Linux and Lua environment?
 

lbenson

Senior Member
OK, I got past that. I found that I had lua 5.0 installed instead of 5.1. That's fixed now, but I got additional errors ("lua: memcached:33: module 'socket' not found:", no field package.preload['socket']", etc.). I fixed that with apt-get install liblua5.1-socket-dev".

So now I have a listener on 11211.

When I run "lua openbridge.lua", I get the following:
Code:
Starting OpenBridge v0.1-alpha
Sun Aug 15 22:22:14 2010        [serial] Configuring serial port...
9600
Sun Aug 15 22:22:14 2010        [serial] Serial port /dev/ttyUSB0 configured succesfuly
Sun Aug 15 22:22:14 2010        [serial] Serial port is open
Sun Aug 15 22:22:14 2010        [memcache] Connecting to memcache server
Warning: Could not connect to localhost:11211
lua: ./Memcached.lua:401: No servers available
My etc/hosts is as follows:
127.0.0.1 localhost
127.0.1.1 dock82

config.ini is
Code:
--[config]
debug = 1
serial_port = '/dev/ttyUSB0'
serial_speed = 4800
memcache_server = 'localhost'
memcache_port = 11211
What next? (Hmm, why does it say "9600" after "configuring serial port" when the config file says 4800?)
 
Last edited:

moxhamj

New Member
Stelios - that sounds fascinating.

I've written a few instructables on this but as you say, the solutions using a PC etc have limitations.

I think it is exciting to consider a small/cheap module that can interface a picaxe to the internet.

It needs to be simple too. I spent a huge amount of time (and needed help from several sources) to get lantronix modules setup. Small box, ethernet in one end, serial out the other, but it used a lot more power than a picaxe and the settings/programming were not easy.

Embedded linux sounds intriguing. It would give a lot of flexibility in programming. Like you say, the ability to take the html of a weather page and filter the data into something simpler for a picaxe to process. The picaxe then might handle some sort of 'real world' interface - eg display the temperature in Athens on an old-school voltmeter. Or bargraph, or led display, or any of the things picaxe is good at.

How much do the boards cost?
How easy is the programming?
What language are you using?
How much current do the boards use?
Do you have some photos?

This sounds a great little project. Keep up the good work!
 

lbenson

Senior Member
Not trying to speak for Stelios, but

>How much do the boards cost? Bifferboard is about $55 US. I hope to run it on the WL-520gU (around $35US). I got in on the buy.com deal for 2 Dockstars at $25US each, and then got another for $30. It is far more powerful than the Bifferboard, which has less processing power than the WL-520gU.

>How easy is the programming? Stelios has done much of the work, so it is mostly getting his code installed (which I have not yet successfully done). I plan to expand it to add new features, like email and updating a web page.

>What language are you using? Lua, a powerful interpreted language which can run on small devices (small by Linux standards--the WL520gU has 4 megabytes of flash, the Dockstar 256 megabytes; original Bifferboard had 1 megabyte and needed a usb drive, but latest has 8 megabytes and could run this stand-alone).

>How much current do the boards use? Bifferboard around 1 watt; Dockstar said to be 3 watts; WL520gU around 10 watts (with wireless enabled).

It's a powerful and flexible arangement, and could well be a good standard for picaxers to use to connect to the internet.
 

steliosm

Senior Member
@lbenson
You need to start the memcached first and then the openbridge. In order to do that you have to start the memcached script and not the Memcached.lua. The later is a library used by the openbridge to access memcached servers.
The serial port is configured using the 'stty' utility. I have noticed that when you change the speed the old speed is reported back by stty. Not sure why it does that.

@Dr_Acula
You can have a look at some pictures at this location:
http://sites.google.com/site/bifferboard/Home/photos/1port-bifferboard-case
I think lbenson answered all your questions already. I'm preparing a web page to provide more information about the project.
 

lbenson

Senior Member
Stelios--yes I did run "lua memcached &" first and got a report that it (something?) was listening on 11211. Then "lua openbridge.lua" came back with the "no servers available" message.

What is the server and how can I independently test for it after having run "lua memcached &"? Is there a site which explains exactly what is being done by memcached for this use?
 

steliosm

Senior Member
The memcached is using the text memcached protocol but onlu supports the GET and SET options. You can see more here:
http://code.sixapart.com/svn/memcached/trunk/server/doc/protocol.txt

After starting the memcached you can telnet to it (localhost 11211) to test the functionality.

Example
Set a value of 2 bytes to 'register' named test that never expires : set test 1 0 2 (after hitting enter you need to give the 2 byte data, eg OK)
Get the value of 'register' test: get test

You can try setting the config.ini the value 127.0.0.1 instead of 'localhost' for the memcache_server option or just make sure that your hosts file has an entry for localhost.
 

lbenson

Senior Member
OK, I'm in now. I did the same installation on a WL-520gU running openWrt (but without the liblua5.1-socket-dev which was required under debian to get memcached to provide a listener). Sending from the picaxe results in the correct debug output from openbridge.lua.

So now the fun begins. I'd still like to get it running under debian at some point.
 

lbenson

Senior Member
I can see that the line that is sent from the picaxe gets split. I sent "SENDTWEET|my_id|my_pw|Test Tweet". I put a debug statement in the send_twitter_cmd function, and can see that my_id and my_pw and the tweet are correct (values in parts[2], parts[3], and parts[4]).

And then my first tweet ever appeared. Looking good. Thank goodness I don't have any followers to see the drivel which gets sent in testing.
 

lbenson

Senior Member
Ok, I added email to the functions which openbridge performs (a limited form of email--one line). To the section of the openbridge.lua code where the commands are identified, I added the following line:

elseif parts[1] == 'EMAIL' then send_email_cmd (parts[2], parts[3], parts[4], parts[5])

Then I added this function.
Code:
function send_email_cmd (my_toaddr, my_fromaddr, my_subject, my_text)
  --
  -- Send an email with ssmtp (one-line body) 
  --   uses file "message" in user's home directory
  --
  os.execute("echo "..my_fromaddr.." > ~/message")
  os.execute("echo "..my_subject.." >> ~/message")
  os.execute("echo "..my_text.." >> ~/message")
  os.execute("echo . >> ~/message")
  os.execute("ssmtp "..my_toaddr.." < ~/message")
end
Stelios may know of a better way to do this, or one more conformant to his coding style.

My picaxe testing program follows. So far I've tested emailing, twittering, and setting a variable.
Code:
'20OBrdg1.BAS tests sending strings to net-connected device
'  if pin1 on, toggle of pin2 increments menu item count, shown in led flashes
'  if pin1 off, toggle of pin2 causes execution of menu item # code
#picaxe 20x2
#no_data
#no_table
symbol pin1PriorStatus = bit0
symbol pin2PriorStatus = bit1
symbol loopCtr = b12
symbol menuItem = b13 ' 1=emai1; 2=set_reg_val; 3=get_reg_val; 4=HTTPGET
                      ' 5=SENDTWEET; 6=PACHUBE; 7=refresh_web_page
symbol maxMenu = 7
symbol ledPin = A.0

dirsB = %11111100 ' legs 17, 18 input switches
dirsC = %10000000 ' leg 4 serial out
adcsetup = 0
pause 1000
high ledPin
pause 1000
low ledPin
pin1PriorStatus = pinB.0 
pin2PriorStatus = pinB.1 
sertxd("B.0=",#pinB.0,#pinB.1,cr,lf)

main:
  if pinB.0 = 1 then
    if pinB.1 = 1 then do while pinB.1 = 1 : loop
      inc menuItem
      if menuItem > maxMenu then : menuItem = 0 : endif
    endif
  else
    if pinB.1 = 1 then do while pinB.1 = 1 : loop
      select menuItem
        case 0: low ledPin
        case 1  ' send email; 
                sertxd("EMAIL",cr,lf)
                serout C.7,N4800_8,("EMAIL|someone@compuserve.com")
                serout C.7,N4800_8,("|From: someone@eastlink.ca")
                serout C.7,N4800_8,("|Subject:  openbridge email test")
                serout C.7,N4800_8,("|testing from picaxe through openbridge",lf)
        case 2: sertxd("SET AT_01 'This is a test variable'",cr,lf)
                serout C.7,N4800_8,("SET|AT_01|This is a test variable",lf)
        case 3: sertxd("GET AT_01",cr,lf)
        case 4: sertxd("HTTPGET",cr,lf)
        case 5: sertxd("SENDTWEET",cr,lf)
                serout C.7,N4800_8,("SENDTWEET|somebody|somepassword|Test tweet",lf)
        case 6: sertxd("PACHUBE",cr,lf)
        case 7: sertxd("REFRESH test.html",cr,lf)
        case 8: sertxd("invalid",cr,lf)
      end select
    endif
  endif
  if menuItem > 0 then
'    sertxd(#menuItem,cr,lf)
    for loopCtr = 1 to menuItem
      high ledPin
      pause 200
      low ledPin
      pause 200
    next loopCtr
    pause 1000
  endif
  goto main
My test program is a little clunky. The circuit has two switches--an on-off and a pushbutton. When the first is on, a button press increments a variable which cycles through 1-7, corresponding to a command to be issued to openbridge. The count number is shown by the number of flashes of the led on pin A.0. When the first switch is off, a press of the button sends the selected command. For instance, if you're getting a single flash and the switch is off, a button push sends an email. If you have five flashes, you get a twitter.

Openbridge is running on a WL-520gU with an openWrt operating system. Both email and twitter are working--picaxe to openbridge to the internet. A neat and flexible solution if you ask me.
 
Last edited:

lbenson

Senior Member
Moving ahead. I've added code to update a web page. This could no doubt be made more elegant. Because of (I think) a Linux permissions issue, I've had to put the template file in a specific place--I've chosen /home/user0, so a user would have to have that directory or change the code.

The program reads a template html file which contains variables labelled At_var00 through At_var99 (as many as needed, no order, and gaps permitted). (I've chosen those variable names for historical reasons--the SimpleLan module used them. Users could change to any variable names they liked.) The variables must be contained within angle braces, e.g., <At_var01>.

The picaxe program uses the "SET" command to set the necessary variables, and then issues the command, "REFRESH|somename", where "somename" is any name you choose. A template file, "/home/user0/somename.template" must exist. That file is read, variables replaced with values, and "/www/somename.html" is written. The web page can then be viewed at http://localIPaddress/somename.html. The site could be internet-enabled through the usual methods.

This assumes that your web server is serving from /www. In openWrt, you could make this happen by issuing the command, "httpd -h /www" (the default port is 80, you could change it--the directory may also be changed).

Here is my sample html template file--it uses 5 variables:
Code:
<html>
<title>3rd Status</title>
<BODY bgcolor="#d0d0d0">
<P style="margin-top: .01; margin-bottom: .01"><b><font color="blue"><font size="5">
<center>Home Monitor Sensor Status</center></font>
<center>Date: <At_var01> (Last Reading: <At_var02>)</center>
</font></P>

<table border="1"><tr><td>

<font size="3" color="black">
<table border="1">
<tr>
<td><font color=red>Centigrade</font></td>
<td></td>
<td>24-hour  </td>
<td>24-hour  </td>
</tr>
<tr align=right>
<td></td>
<td>Temp</td>
<td>low</td>
<td>high</td>
</tr>
<tr align=right>
<td align=left>Outside:</td>
<td><At_var03></td>
</tr>
<tr align=right>
<td align=left>Upstairs:</td>
<td><At_var04></td>
</tr>
<tr align=right>
<td align=left>Basement:</td>
<td><At_var05></td>
</tr></table>
</td>
</table>
</BODY>
</html>
Here is the served web page:

In the openbridge.lua program, I again added a line for a new command:

elseif parts[1] == 'REFRESH' then send_refresh_cmd (parts[2])

Here is the new function:
Code:
function send_refresh_cmd (my_htmlfile)
  --
  -- refreshes an html file using previously stored values
  --   uses file "?.template" in /home/user0
  --   puts "?.html" into /www
  --
  my_file = "~/"..my_htmlfile..".template"
  filein = io.open(my_file,"r")
  if (filein == nil) then
    print("Can't open "..my_file) 
  else
    my_file = "/www/"..my_htmlfile..".html"
    fileout = io.open(my_file,"w")
    if (fileout == nil) then print("Can't open "..my_file) filein:close() end
  end
  if (filein ~= nil and fileout ~= nil) then
    for line in filein:lines() do
      n = string.find(line, "<At_var") -- variable item
      if n then else n = 0 end    -- if nil, set to 0
      while n > 0 do              -- there's a variable 
        my_register = string.sub(line, n, n+8) -- get the variable name, At_var00-At_var99
        my_data = memcache:get(my_register)
        if my_data ~= nil then
          line = string.sub(line,1,n-1) .. my_data .. string.sub(line,n+10)
          n = string.find(line, "<At_var") -- variable item
          if n then else n = 0 end    -- if nil, set to 0
        end
      end
      fileout:write(line,"\n")
    end
    fileout:close()
    filein:close()
  end 
end
Here is the picaxe demo program with the new REFRESH code--case 7 (note that a variable can contain html coding as well as values):
Code:
'20OBrdg1.BAS tests sending strings to net-connected device
'  if pin1 on, toggle of pin2 increments menu item count, shown in led flashes
'  if pin1 off, toggle of pin2 causes execution of menu item # code
#picaxe 20x2
#no_data
#no_table
symbol pin1PriorStatus = bit0
symbol pin2PriorStatus = bit1
symbol loopCtr = b12
symbol menuItem = b13 ' 1=emai1; 2=set_reg_val; 3=get_reg_val; 4=HTTPGET
                      ' 5=SENDTWEET; 6=PACHUBE; 7=refresh_web_page
symbol maxMenu = 7
symbol ledPin = A.0

dirsB = %11111100 ' legs 17, 18 input switches
dirsC = %10000000 ' leg 4 serial out
adcsetup = 0
pause 1000
high ledPin
pause 1000
low ledPin
pin1PriorStatus = pinB.0 
pin2PriorStatus = pinB.1 
sertxd("B.0=",#pinB.0,#pinB.1,cr,lf)

main:
  if pinB.0 = 1 then
    if pinB.1 = 1 then do while pinB.1 = 1 : loop
      inc menuItem
      if menuItem > maxMenu then : menuItem = 0 : endif
    endif
  else
    if pinB.1 = 1 then do while pinB.1 = 1 : loop
      select menuItem
        case 0: low ledPin
        case 1  ' send email;
                sertxd("EMAIL",cr,lf)
                serout C.7,N4800_8,("EMAIL|somebody@compuserve.com")
                serout C.7,N4800_8,("|From: somebody@eastlink.ca")
                serout C.7,N4800_8,("|Subject:  openbridge email test")
                serout C.7,N4800_8,("|testing from picaxe through openbridge",lf)
        case 2: sertxd("SET AT_01 This is a test variable",cr,lf)
                serout C.7,N4800_8,("SET|AT_01|This is a test variable",lf)
        case 3: sertxd("GET AT_01",cr,lf)
        case 4: sertxd("HTTPGET",cr,lf)
        case 5: sertxd("SENDTWEET",cr,lf)
                serout C.7,N4800_8,("SENDTWEET|somename|somepassword|Test tweet",lf)
        case 6: sertxd("PACHUBE",cr,lf)
        case 7: sertxd("REFRESH minimum.html",cr,lf) ' requires minimum,template
                serout C.7,N4800_8,("SET|At_var01|August 16, 2010",lf)
                serout C.7,N4800_8,("SET|At_var02|August 15, 2010, 10pm",lf)
                serout C.7,N4800_8,("SET|At_var03|20</td><td>14</td><td>22",lf)
                serout C.7,N4800_8,("SET|At_var04|22</td><td>18</td><td>26",lf)
                serout C.7,N4800_8,("SET|At_var05|15</td><td>14</td><td>15",lf)
                serout C.7,N4800_8,("REFRESH|minimum",lf)
        case 8: sertxd("invalid",cr,lf)
      end select
    endif
  endif
  if menuItem > 0 then
'    sertxd(#menuItem,cr,lf)
    for loopCtr = 1 to menuItem
      high ledPin
      pause 200
      low ledPin
      pause 200
    next loopCtr
    pause 1000
  endif
  goto main
 
Last edited:

MPep

Senior Member
You obviously overcame the Baud rate discrepency between the Lua program and the .ini file. What was it?
 

lbenson

Senior Member
>Baud rate discrepency

Stelios said in post 6 that the speed displayed is what it is being changed +from+. Odd, but I've had no problem with baud rate.
 

lbenson

Senior Member
Stelios--what is the reason for using memcached (a neat program, no doubt) for saving associative values instead of lua's built-in associative array mechanism?

One possibility I have thought of is that it would allow an external program to set values which the picaxe could then check--for example a lua cgi program for a web page could set values which the picaxe could pick up to control attached devices. So it can effectively provide shared memory between separate programs--less clunky than writing and reading files. Could you expand on the capabilities it provides?
 

lbenson

Senior Member
Another question. I tried to implement the GET function. Since I don't know how many characters are coming, I terminated them with a line feed, and then am getting them one at a time with serin. The first character I get back is good, but the rest are garbage--the known problem of characters coming at too fast a rate for the picaxe to cycle around and get the next character in time.

So I put a dummy command in the send loop. In this case, "os.execute("echo hello > /dev/null)". This turned out to work, but it might not on a faster machine. The linux "sleep" command operates in seconds, so would slow things down significantly. There is also a "usleep" command which operates in microseconds, but apparently doesn't work or isn't available under openWrt. Is there any better and more portable solution?

Of course, one solution would be to use hserin for background receive, but I'm planing to use this for a device which will be controlled by the picaxe.
 
Last edited:

steliosm

Senior Member
lbenson you are fast!

I'm working on documenting the project and I didn't have much time to add functionalities to the code. I'll add the email option to the code and look for a place to store code easily. I'll probably re-write your email function, if that's OK with you, in order not to rely on the ssmtp application. Lua socket has support for SMTP, so it's pretty simple. It's nice to see that people can read and modify my code.

Having a memcache allows for sharing the variable data easily between processes. You can even connect to the memcached server from a remote location on the network and get/set variables. Matt has generously offered to write the memcached server program and he will be maintaining it as well. We can add more stuff/functionality we see fit.

The Web page part seems to be the most complicated for now. I was thinking of using CGI scripts based on Lua to do a more 'dynamic' variable substitution. I like your approach as well. I will play around a bit and see what we can do.

About the GET function, you could try to use a slower baud rate between the openbridge and the picaxe. Using hserin will certainly help a lot.

Go and get an account on Pachube! This is where the fun begins ;-)

You could run OpenBridge almost everywhere you can run a recent version of OpenWRT and Lua.
 

lbenson

Senior Member
Stelios,

Your code is easy to follow, and easy to add to. Feel free, of course, to modify my code in any way (I felt free to do so with yours). I don't know anything about Lua socket, so I am pleased to see some examples to see how it works.

Regarding GET, I tried a slower baud rate--1200, the lowest the 20X2 would go without reducing its speed. No joy there. A working usleep would do the trick. I'm afraid my delay kludge would not work on a Sheevaplug or Dockstar (5 times as fast), so something portable would be an improvement. hserin is too valuable to use for this purpose, to my mind. It may be that single-byte GETs will be sufficient, but that is being restrictive for no very good reason.

Regarding portablility, something is missing in Debian Squeeze (testing). Liblua seems broken up into 15 or 20 parts, and I'm not sure which parts I need. If I get the time, I'll try it on Debian Lenny(stable).

Is there a place where the work on openbridge is discussed? If additional people are working on the project, I'd be interested in knowing what they are thinking. Thanks for your work on this very useful project.
 
Last edited:

lbenson

Senior Member
I created a pachube account and set up a feed. I haven't been able, tho, to make a connection. From the picaxe side I am sending:

PACHUBE|myapikey|api/feeds/9544.json|22,19

Of course, for myapikey I am sending the key provided by pachube. I get the following error message.

Tue Aug 17 10:55:31 2010 [SET] Seting register: http_status with value: invalid host ''
lua: openbridge.lua:82: attempt to concatenate local 'my_value' (a nil value)

The program then terminates. I may be sending the wrong feeds value to cause the original error, but in any case, there is a bug in reporting what the error is--this causes the program to terminate.

But exactly what should the PACHUBE command look like, exclusive of the apikey?
 

lbenson

Senior Member
By the way, I haven't figured out what the HTTPGET command would be useful for. What had you anticipated doing with it?
 

steliosm

Senior Member
Hello lbenson.

The Pachube command works like this: PACHUBE|<apikey>|<feed url>|<data>

e.g.
PACHUBE|ADASD123341123HD13|http://www.pachube.com/api/feeds/12074.csv|22

You need to supply the whole pachube URL.
 

steliosm

Senior Member
By the way, I haven't figured out what the HTTPGET command would be useful for. What had you anticipated doing with it?
You can use it to fetch data from remote servers or send data to remote servers. Very useful if you are doing your own telemetry project and you already have the application ready. Most of my projects, like the home-monitor, had a backend script that was receiving data through an HTTP GET request. I was sending 2 temperature values (in house/ outside house) using a request like http://steliosm.net/homemonitor/data.php?temp1=XX&temp2=YY. I can now replicate this functionality using the OpenBridge' HTTPGET command.

I have a draft description of the project outlined here and also some command examples:
http://steliosm.net/openbridge.html

I have also created a Google Group so we can discuss about further development and problems. The group is located here:
http://groups.google.com/group/openbridge

I hope this will get as started.
 

lbenson

Senior Member
Hello lbenson.

The Pachube command works like this: PACHUBE|<apikey>|<feed url>|<data>

e.g.
PACHUBE|ADASD123341123HD13|http://www.pachube.com/api/feeds/12074.csv|22

You need to supply the whole pachube URL.
I had tried pachube with the full url, but had the same error. I tried again and got it again. I'll have to dig further to see exactly where the error is appearing, and what "host" is being referred to.

Thanks for setting up the web sites. I've joined the group. Hope there gets to be traffic.
 

steliosm

Senior Member
lbenson , I just tried the Pachube functionality and it worked fine.
This is the command I used:
PACHUBE|59afdc...94cf4fb2152f19|http://www.pachube.com/api/feeds/9296.csv|13

My feed got updated as you could see if you go to the pachube's site. Do you still get the same message when you try?
 
Last edited:

rhaseman

New Member
Openbridge Development

the bifferboard solution that Stellios is working on sounds great. I would also love to see a inexpensive non-wireless router set up to run the Openbridge software. I have been trying to find OpenWrt install instructions for use on such a router but so far I have only come across instructions for various routers that have wireless installed. I know that you can deactivate the wireless on these routers but the wireless routers tend to use much more power even with it deactivated. A small simple setup on a non-wireless router would offer a attractive alternative to the Bifferboard solution and might get other people to try it out. I am not a linux pro at this point and wondered if anyone had suggestions on routers I might try to hack for this.

Rick
 

steliosm

Senior Member
Hello Rick.

My initial idea was to use the bifferboard device and release a 'special' firmware image that you would flash on it and have an OpenBridge up and running without needing to compile anything.

We could possible expand this kind of functionality for other routers, but that would need time and experimentation. Anyone would like to maintain an openbridge port for another device?

Bifferboard current consumption is less that 200mA - that is without having anything plugged on the USB but having the network cable attached.

@lbenson: Great to hear that it works!
 

steliosm

Senior Member
Project update: Files release, download from here: http://steliosm.net/openbridge.html
This is a pre-alpha version of the projects and it only contains the openbridge software. It's not a complete bootable firmware that can be flashed on a bifferboard device.
Download the files if you would like to play with it or test the functionality on your own hardware device.
 

lbenson

Senior Member
Rick,

The effort of porting openWrt to a new router is apparently non-trivial. I haven't tried it and don't intend to, but you probably won't find the openWrt folks porting to low-end non-wireless routers. That said, I find that the WL-520gU which I have been using runs significantly cooler with wireless turned off. I haven't measured the current draw.

They aren't routers, but the older NSLU2 and newer Dockstar don't have wireless and do run openWrt. Dockstar is said to be about 3 watts (exclusive of usb devices).

Stelios--regarding an openbridge port to other devices, do you think that would be necessary? From what I have done so far, it would seem that you could download stock openWrt firmware, flash it, make a few configuration changes and software installations with opkg, and be up and running (assuming a device with usb). I have built my own openWrt firmware for the WL-520gU because it has only 4mb of flash, but any larger device should be able to use the stock firmware. The only additional thing that you really need, as far as I know, is the driver for the usb/serial for connecting to the picaxe, and luasocket.
 

steliosm

Senior Member
lbenson, having a router or device that is able to boot OpenWRT still requires the user to telnet into the device and configure/install additional software. Even if you provide a step-by-step guide for flashing and configuring the OpenWRT with OpenBridgesome I think that you are going to have a few users will problems or confusion while following the procedure.
My initial idea was to provide a hardware/software combination that require "almost" zero configuration and preparation to work. Having support for a wide number of devices would benefit users that might already have the equipment or have access to cheap hardware, such us the openmesh device.
Of course, for those who can manage creating firmware images and installing/configuring packages there will always be the option to use the openbridge software and skip the firmware images.
 

rhaseman

New Member
Stelios - I realize how valuable your bifferboard implementation is going to be because you will be able to buy it, load the software, and then put it to use without digging into any of the low level linux programming issues. As far as I know, there is not really any product out there which offers that kind of functionality without requiring the user to be a linux specialist so this is going to really help people who want to link a picaxe or other microprocessor to the internet. I really look forward to seeing how this product develops.

The reason I am interested in a low cost router implementation is that it might help people try some things out before going to the expense of the bifferboard implementation. If we found an inexpensive piece of hardware and developed good instructions for converting it to a OpenBridge device that would allow more people to experiment with internet connectivity projects (sort of like the inexpensive 433 Mhz transmitter /receiver pairs allow people to experiment with wireless data transfer technology) and see what is possible. I think that something based on the NSLU2 might fit this bill - there is good documentation on implementing OpenWRT on it and the hardware is fairly inexpensive. I would not want to use a modified (hacked) router on a commercial product but it would be fine for testing things out in the lab.

Rick
 

hippy

Technical Support
Staff member
The problem with targeting stock hardware is deciding what to support. I'd like my bootsale bargain Wi-Fi routers to be chosen as I've got a cupboard load of those and I guess everyone would prefer what they already own or can buy cheap to be chosen. NSLU2 is a superb platform and sounds appealing but it hasn't been manufactured for two years. Even if a currently ubiquitous router is chosen today it might not exist tomorrow. What's readily available in one country isn't heard of in another.

The same can be said of BifferBoard or anything else but one has to make a decision and I think targeting a single well defined platform to start with, delivering a complete 'ready to go' system, is the best way to go.

I think that's got to be steliosm's goal and priority; others can pick-up what he has, work alongside or run with it themselves for other hardware.

I believe everyone would agree that getting OpenBridge to run anywhere and on anything ( and that also includes routers, NAS's, netbooks, phones and desktop PC's, Windows and everything else as well as Linux ) would be a good thing but that come come later.
 

manuka

Senior Member
It's worth pointing out that the official IEE802.11s "mesh" standard is apparently not far off. With the blistering rate of change in this field it could well be that by this time next year such "s" offerings are as prevalent as today's "n" devices. "s" was used in draft form with the infamous OLPC (One Laptop Per Child) back in 2007 in fact, although their latest XO 1.5 offering has dropped it.
 

lbenson

Senior Member
Rick,

Not only is the NSLU2 (a fine device--I have 5) well past end-of-life, it is also dated and not inexpensive (currently the only Buy-it-now price on ebay is $120 US, and I never bought one for much less than the cost of a Bifferboard).

For inexpensive, it's hard to beat the WL-520gU (on which I currently have openbridge running)--right now $33.72 US after rebate at newegg.

I don't doubt that it would run on the much more powerful Dockstar, which will run openWrt, and which has sold variously over the last two months at between $18 and $40.

Once one has openWrt running (which is not necessarily easy), loading openbridge is pretty trivial.
 

Froggs

Member
Think piece on PICAXE and network connectivity

First let me applaud steliosm, ibsenson, and others for their enthusiasm on this topic. I would like to add a few comments as a think piece. Please excuse me if I repeat what has already been said in this or other threads.

The objective is as steliosm indicates is &#8216;to try to fill in the gap between PicAxe microcontrollers and the Internet. We have used several techniques in the past.. and to create a network module that will act as a bridge between the PicAxe and the Internet&#8230; &#8216;

This prompted me into some &#8216;google research&#8217; admittedly from a low start point but this focused my thoughts:

I am not overly technical but do understand the concepts. I am also a great believer in recognising function over form (but within realistic constraints&#8230; but what are these constraints?). From my perspective I am enthusiastic for a solution that is as close to &#8216;plug and play&#8217; as possible.. not because I am not interested in the effort (indeed this is part of the fun) but my preference is [for me] to add functionality at the &#8216;project&#8217; end not the technology enabler&#8230; just a personal perspective. So to constraints:

> to obtain basic serial/ ethernet [TCP/IP] (or other network protocol) connectivity?
> to [additionally] serve web pages?
> to do this using [only] &#8216;open&#8217; techniques? [given that PICAXE is not &#8216;open&#8217;?]
> to do this with an emphasis that cost should be low? [but what is low?]
> to minimise software complexity? [extent of knowledge of unix (or derivatives) and scripting?]
> to use (or not as the case may be) &#8216;other&#8217; programming languages and compilers etc
> to minimise hardware complexity? [a hardware environment supporting unix [either physical or virtual?] and [ability to patch/ flash or otherwise do &#8216;stuff&#8217; with manufacturers equipment?]


AND as steliosm says in post #10 &#8216;Just a small note for Dr_Acula, the end user will not have to program the device at all&#8217;

SO that&#8217;s all good and simple? But setting up the .Lua&#8230;. ? ? ? etc

NOW. To the googling bit.

Yes the Bifferboard looks good. Small foot print. Cheap. Functional. Lots of positive noise on web etc.

Other platforms exist also as steliosm noted in his initial post. My research efforts pointed me to both Lantronix and Tibbo (also both cheap). But what really interested me with the Tibbo product is the low cost and ability to program in basic (object oriented toolset and free download). There are [retail] distributors in most regions. See link http://tibbo.com/products/?form_filter=yes&wclass_set=out


AH So now I ask what&#8217;s up with the PICAXE.net Starter Kit NET001 at £99?

Just a thought piece?

Regards
J
 
Last edited:

lbenson

Senior Member
Froggs,

I don't wish to speak for Stelios, but it is my impression that he wishes to provide software (a pre-configured openWrt system) which can be flashed to the Bifferboard by the end-user, with no configuration needed. Then the user would plug the Bifferboard into the network ethernet on the one side and serial or usb/serial from a picaxe on the other. No configuration would be needed if the pre-compiled serial port and baud rate were suitable--the user would program the picaxe and use the functions provided by openbridge on the Bifferboard.

There is a password issue with a pre-compiled version--either there is one and it is publically known, or there isn't and the system is open via telnet. In either case the end-user has to make a change in the Linux system or the result is a moderately or very powerful Linux system potentially open to hacking.

My own desire is to use openbridge on as many platforms and Linux distributions as I like. Right now Dockstar with 3/4 usb ports, a lot of flash (256mb), and a lot of speed (1.2gHz) looks ideal to me, but in this field, ideals change. Some might wish to use it on a full PC. I haven't tried openbridge on the Dockstar running openWrt--I suspect it would just work. Running Debian Lenny, there is a problem with memcached which remains unresolved.

Users who don't want to tinker with Linux will probably have to use the Bifferboard--otherwise there are too many options.
 
Last edited:

steliosm

Senior Member
@Froggs: I have had a look at Tibbo. It's a fairly cheap device and of course programmable through a kind-of-Basic language. It's easy to do basic stuff (serial to telnet) but it seems complicated to do complicated stuff. Still, the end user will have to either learn how to program tibbo (another language to learn) or find a suitable application to put on tibbo and do whatever the user wants to do.

What lbenson points out in his last post is true. The user will either have the option to go out and buy a bifferboard and then download the openbridge firmware to flash it or download the openbridge software and run it on his pc, embedded, etc. Yes, the user will have to know how to work on a Linux machine if he choose to download the application and run it on his embedded device.

Now, the telnet/ssh password can be an issue if the service is left running on the device (bifferboard). My plans are to disable this service since the user will not have to actually work on the system itself.
 

hippy

Technical Support
Staff member
There are mechanisms to make an embedded system both protected and plug-and-go when delivered. That can be sorted later. Leave Telnet and others open on firmware which is pre-release. You can lock it down for production if you don't have a solution by then.
 

Froggs

Member
Guys.. Thanks for your comments. I guess that ultimately I was attempting to solicit some further debate on the objectives (don’t get me wrong I am very enthusiastic at the embedded Bifferboard concept!)

Ibenson: remarks ‘I don't wish to speak for Stelios, but it is my impression that he wishes to provide software (a pre-configured openWrt system) which can be flashed to the Bifferboard by the end-user, with no configuration needed. Then the user would plug the Bifferboard into the network ethernet on the one side and serial or usb/serial from a picaxe on the other. No configuration would be needed if the pre-compiled serial port and baud rate were suitable--the user would program the picaxe and use the functions provided by openbridge on the Bifferboard’.

Steliosm: If then the goal, and as Hippy remarks is that ‘There are mechanisms to make an embedded system both protected and plug-and-go when delivered’ then I think that the majority of my think points are addressed. I for one will be more than keen to get together the bill of materials and try it out; but from reading the posts (on this forum) looking at your own site http://steliosm.net/openbridge.html [last update 18/03/2010] (and http://groups.google.com/group/openbridge/topics)
I don’t feel sufficiently confident yet…

So until then; I keep watching this space and hope that others a little closer (and able) with the technology will assist. If however (and when you have the time?!) there is a further write-up to the point that I can take it further (BoM, idiots guide etc), then I will wait.

So good luck and I wish you well.

Regards
J
 
Top