SimpleLan and PicAxe

steliosm

Senior Member
SimpleLan has landed!
I finally got the module in my hands. I setup the breadboard an run a few test. Using t2400 as a parameter for serial communication sending data to the module was easy.
The email function worked fine although I must admit that the 256bytes of the 08M run out very fast. There is quite a big number of registers in the module to be written in order for the mail to be sent.
Setting values on the module's registers so I can see then through the web was also very easy.

What I noticed was that my 1Amph rated L7805 regulator was heated very much after 20-30 minutes playing with 08M and SimpleLan.

Besides that the modules looks very good :)
Are there any tests you would like me to run on the module?
 

jmumby

Senior Member
Not heard of this module but from what I gather from your post you can send email and perhaps host a webpage. Aside from this what else can you do? Im figuring it won't have the speed for packet analyzing or network statistics?
 

MORA99

Senior Member
Did you use a picaxe for the initial configuration too ?

If it can host a webpage it could be used for lots of things, network controlled relays, sensors, etc.

Maybe even connecting two picaxes together over the internet just for the sake of it.
 

demonicpicaxeguy

Senior Member
www.avcomtec.com sell them
for $29.95 thats not bad for what they do
it would be interesting to have several picaxes around the world talking to each other
 

Brietech

Senior Member
Can it "send" info over the network (UDP packets, maybe?) in any way, apart from E-mail? Also, is there any way to receive information via a network? It certainly does sound cool, but it sounds more like a 1-way communication device.
 

Brietech

Senior Member
Kind of unrelated, but has anyone ever gotten a modem-to-modem connection to work via two picaxes (or a picaxe and a pc) over phonelines? That would be fairly cool as well.
 

papaof2

Senior Member
The SimpleLan card can do a number of things, including send/receive UDP packets.

The manual is a 287KB PDF: <A href='http://www.avcomsmt.com/SimpleLan_manual.pdf' Target=_Blank>External Web Link</a> http://www.avcomsmt.com/SimpleLan_manual.pdf

John
 

demonicpicaxeguy

Senior Member
with the pic --&gt; modem --&gt; phoneline ---&gt; modem ---&gt; pic it's actaully quite easy to do
as long as you know your AT commands ( gee that brings back memmories)
it's somthing that has been implemented in a few data loggers (weather,meter reading,security,etc) where you just dialup through hyperterminal with the text file capture ready and as soon as it connects you're floodded with the captured data and then it hangs up
 

moxhamj

New Member
This looks very interesting.
Put a heatsink on the 7805 :)
Re two way comms it certainly can can sense a variable (temp) and put it on a webpage.
I'm reading through the datasheet. Can it do something in response to a click by a user on a button on a webpage?
And if it can do that, can it do something in response to a message sent automatically by another device? Responding to an email and turning on a led for instance?

At the very simplest level, what would be really useful is two of these devices - device 1 says to device 2 &quot;turn on a led&quot; and device 2 sends back a message to device 1 &quot;led has been turned on&quot;. Interface this to picaxes and one could push a button to turn something on, and get feedback that it has indeed turned on. Is this possible?
 

steliosm

Senior Member
Yes, you can read and write to the registers through a Web Page. A simple generic Web Form will get user data and submit it to the SimpleLan where it will be stored. You need to pay attention to the register sizes since you have 4bytes, 16bytes and 64bytes sizes.

SimpleLan can send and receive UDP messages. When a UDP message is received the data is stored to a special register in order for the PicAxe to read it. The PicAxe must have an internal loop to check the registers.

Having two PicAxes directly communicating over the Internet could be done by the use of the UDP protocol.

Also, another cool thing about SimpleLan is that it can act as an Alerting device. So, by connecting a few PIR rensors to the PicAxe, the PicAxe is able to send an alert email whenever the PIR sensors 'feel' a motion. Of course, you need a 24/7 internet connection.
 

hippy

Technical Support
Staff member
<i>Having two PicAxes directly communicating over the Internet could be done by the use of the UDP protocol. </i>

That's what I'm interested in hearing, although more regarding LAN than whole world internet.

This is I believe an ideal solution to Dr Acula's backbone network that's been discussed recently. Once there's a common carrier ( in this case &quot;Ethernet Packets&quot; ) that can go anywhere there is an Etherenet-to-XYZZY interface available.

It's also not limited to point-to-point, one-to-one mapping. All devices can be set to receive all PICAXE packets and then use the contents of the packets to determine if they are actually for themselves or not. All PC's in the world could potentially see any PICAXE's cry for help and act on it, while others can listen to just one PICAXE it chooses to pair with. Conversely each PICAXE can choose who is allowed to control what it does.

It's not quite this simple in practice, but the potential is there.

This also breaks away from the accepted view that access to, and information from, a PICAXE ( or other embedded device ) has to be via a Web Browser (HTTP) interface. It gets back to the simpler notion of data packets moving around the world.

Once one chooses a standard backbone protocol, one can use the tools which already exist to support it. Instant wireless bridging between PICAXE's using standard WiFi components, inter-continental ( one day inter-galactic :) )data transfer and control courtesy of our ISP's and a modem or broadband connection.

It doesn't preclude Browser access because all that is needed is a lump of code ( a server somewhere ) which can pull in those packets and present them in a form a web browser can connect to.

<i>by connecting a few PIR rensors to the PicAxe, the PicAxe is able to send an alert email whenever the PIR sensors 'feel' a motion. Of course, you need a 24/7 internet connection. </i>

Not necessarily; this is the beauty of an all-pervasive backbone protocol. As long as something somewhere can pull that alert off the net and identify it, it can pass it on in some form so you'll get it.

That may be by sending an SMS to your mobile phone, a message to your Pager, can dial up your voice-only phone and play back a pre-recorded message, as well as simply putting it on a 2x16 line LCD which sits on top of the TV :)

One day, in our perfect world, Rev-Ed will sell a simple and cheap box of tricks with an RJ45 or WiFi aerial at one end and a simple to-PICAXE connector at the other and offer UdpSetup, UdpIn and UdpOut commands and this will all be so easy to do we'll wonder what the fuss was ever about.

Until then it will be interesting to hear how you get on with SampleLan interfacing. Have fun !
 

boriz

Senior Member
XYZZY !

That takes me back. Colossal adventure.

Now we both know how old the other must be (at least).
 

Brietech

Senior Member
Hippy, in order to send a UDP packet, doesn't it require an IP address for the destination? I don't think &quot;broadcasting&quot; like that would work unless you knew every other chip's IP. We need someone with a static IP and a simpleLAN to set up a picaxe nameserver =)
 

MORA99

Senior Member
Why would you need a simplelan to host the nameserver ?
The published picaxes could just use a shared domain and the existing DNS system.
And if thats too complex, a simple udp system could be setup on a static host to perform the dns.

 

papaof2

Senior Member
XYZZY - Plover - &quot;You are in a maze of twisty little passages...&quot;

Did you ever play Colossal Cave on a DEC PDP 11-23, running UNIX on 2 8&quot; floppies? And did you draw the map on multiple sheets of 11&quot;x17&quot; paper?

John
 

hippy

Technical Support
Staff member
<i>Did you ever play Colossal Cave on a DEC PDP 11-23, running UNIX on 2 8&quot; floppies? </i>

DECsystem-10 - None of that new fangled stuff !

<i>And did you draw the map on multiple sheets of 11&quot;x17&quot; paper? </i>

Didn't everyone who is anyone :)

Edited by - hippy on 13/08/2007 01:24:33
 

moxhamj

New Member
Is $29.95US the best price?
I read once that by 2010 95% of the internet traffic would be machine to machine. Maybe that will happen (along with flying cars), but looking at what is out there for embedded controllers, they all seem to be $200-$350. This is why this device is quite exciting. Price still needs to come down a bit more if we are going to have &quot;talkie toaster&quot; for $19.99 talking on the internet.

At $29.95 I suspect a home automation system sill may be cheaper using this device as the interface to the internet, and then building a slow (2400baud) serial router using picaxes for the low level comms around the house. I drew up a router schematic last night - will post it once it is breadboarded etc.

How does one get a static IP for these devices? Do most ISPs still charge extra for static IPs?
 

Brietech

Senior Member
Pretty sure most ISP's still charge extra. It would be fun if there were a significant number of net-connected picaxes out there (enough to warrant a central server). Think they give discounts for large orders? Maybe we could get a group-buy together.
 

hippy

Technical Support
Staff member
<i>Hippy, in order to send a UDP packet, doesn't it require an IP address for the destination? I don't think &quot;broadcasting&quot; like that would work unless you knew every other chip's IP. </i>

Everyone should receive broadcasts ( IP address 255.255.255.255 ), but everyone would needs to know where it came from to use the data, and that would be the sender's IP address in the packet.

Broadcasts may not travel through firewalls or between ISP's so they'd have to be wrapped in something which does, and then be unwrapped at the other end.

<i>We need someone with a static IP and a simpleLAN to set up a picaxe nameserver =) </i>

If we wanted every PICAXE to be known by name there would need to be some mechanism. That could use standard DNS resolving to get to a home IP, then each owner could run a server advertising the PICAXE's and ID's they have within their networks.

An additional problem comes in knowing what any received data from any particular source meant. That could possibly be solved using something like SNMP ( simple network management protocol ), where a sender also publishes the meaning of what data it sends and what it accepts. Credit card chips use a clever 'file system' which could be another way of approaching things.

For a local network you're free to implement whatever you want, but creating a universal standard gets harder.
 

hippy

Technical Support
Staff member
Dr_Acula : <i>At $29.95 I suspect a home automation system sill may be cheaper using this device as the interface to the internet, and then building a slow (2400baud) serial router using picaxes for the low level comms around the house. </i>

You are entirely right. SERIN and SEROUT are free and easy(ish) to use. It will be a while before direct ethernet is near zero cost or easy to use.

The tipping point will be if UdpIn and UdpOut or similar commands are implemented in firmware because it would make networking from a PICAXE programmer's perspective as simple as it is to use I2C, SPI or one-wire devices, and the same will be the case if UsbIn and UsbOut appear. At that point the ease of use and advantages they bring start to outweigh the extra hardware cost.

Providing what you send over serial is 'what would be a UDP packet' it means that it becomes easy to upgrade the network if you ever choose to. As soon as the internal network protocol is different to an external protocol, all sorts of complications arise - At the very least, protocol converters and routers are needed as you've identified.

Getting a system designed which, at the progam level, sees the exact same data whether it comes via ethernet, RS232, ZigBee, MiFi, 433MHz, Bluetooth, USB, Firewire or whatever is the ultimate goal. PC's achieve this with hardware drivers and protocol layers which convert everything to a standard format which is thrown onto an internal highway in a standard format which applications extract data from. Unfortunately the PICAXE is probably too constrained for such things to be written by end-users in most cases, hence the main problem with trying to design any standardised network of PICAXE's.

It's that rock and a hard pace scenario. The ideal solutions are too expensive, potentially too complex to control, or the code overheads too high. The solutions which can be implemented easily and cheaply cannot be scaled or easily extended.

For 'ubiquitous PICAXE networking' I don't currently see any realistic alternative to serial. And I see everyone most likely re-inventing the wheel, and building proprietary solutions whenever they need to do networking.
 

moxhamj

New Member
Re XYZZY, I have fond memories of these text based games, with their generic error message &quot;You cannot do that here!&quot; Oh, ok, I'll go and do it somewhere else then...

Hippy - wouldn't it be great if ethernet commands became part of picaxe basic? <A href='http://findarticles.com/p/articles/mi_m0CGN/is_3728/ai_55508324' Target=_Blank>External Web Link</a> is an article about a web server running on a 12C509 PIC, and this was from 7 years ago, so surely it can be done now?

I'd be very interested to hear of Stelios' experiments and what can be done with this new module.

 

steliosm

Senior Member
Having a lot of network PicAxes talking to each other over the Internet it takes more than just a simple ethernet module. It needs a protocol t be defined and it needs quick and robust workarounds for the problems. The biggest problem now seems to be DNS or Where-Is-That-Other-PicAxe related. The easy way would be to lease a static IP and register a domain name for each node. But is beyond the budget. A quick way would be to implement a global server so every PicAxe can send data to and read data from. Virtual Private Servers are cheap to lease these days. All is takes is a form of a UDP 'chat' server in order for the nodes to send data and read data.

As for the price of the module, I suspect in orders of 1K should be less. As Hippy already described it would be great to have Rev-Ed offer similar modules in this price (or less). The UDPIn, UDPOut, Email, etc. can be defined as functions that anyone can copy and paste in their code. The catch here is that you need a PicAxe with a lot of program memory or you 're gonn run out fast. I could barely test the Email function of the module before I run out of space in the 08M.
 

moxhamj

New Member
Brainstorming re protocols. Most ISPs seem to give away webspace. Even if not, there are certainly places on the internet where one can sign up for a free webspace. One could even create a webpage so it looks legitimate, but the primary purpose of this space is to act as a scratchpad for files. It is possible to ftp files to and from that space automatically.

So I could invent my own 'static' IP address, which might simply be my international phone number. I can tag onto that the time and date and my dynamic IP address <A href='http://www.ip-adress.com/' Target=_Blank>External Web Link</a> and upload a one line text file to the website. Now any other program anywhere the world can find me. If I upload once an hour or once a day then even if the ISP change the address I will soon be able to make contact again. A housekeeper program can go through the website every now and then and delete out of date files and/or compile lists of active addresses. (I can write the code for that if this idea takes off.)

The bit that I am not sure about is how to send data from these little modules. Can these modules discover their own IP address? Can they do an ftp of a file (or at least, write a file in a known location)? If this is possible, then it would be possible to use cheaper dynamic IP addresses.


Edited by - Dr_Acula on 13/08/2007 07:39:25
 

steliosm

Senior Member
Dr_Acula those modules can only send UDP packets (and emails of course). They do know their IP number which is also written in a register so the microcontroller can read it.

I have same code samples based on what this module can do. I still need to test the UDP receive function (I promise to do it later to day). Check the link here:<A href='http://www.steliosm.net/picaxelan.html' Target=_Blank>External Web Link</a>

Your idea is a form of DynDNS. The problem here is that you need to be able to manage UDP datagrams in order to get the info (IP addres of the PicAxe and maybe a message). that is why I said that Virtual Private hosting is cheap these days. On a server like that you are able to run your own software and not just web pages. I will post my python code for a simplistic UDP server.

Also, most of the new broadband routers have built in ability to update a dynamic DNS site such as no-ip.com and dyndns.org. This could probably save you some time figuring out how to update your IP address.
 

moxhamj

New Member
Stelios - you are way ahead of me now! I'm only just catching up with how UDP works.

I guess lots of networks have found workarounds for dynamic IP addresses. Bittorrent and skype would be a couple of examples. Clearly there needs to be some sort of central server. The two systems would be either to have all messages go through that server, or to borrow from the bittorrent model, for the server to help individuals find each other, and then use a model like distributed hash tables to enable users to find each other even if the central server goes down. I'm sure there are a number of answers.

Am looking forward to your tests on receiving. Does this mean that if I send your little device an email (appropriately formatted) then it could turn on a led?

 

steliosm

Senior Member
Dr_Acula you could make a LED turn on on my breadboard if you send me a UDP message or if you select to do so from the SimpleLan web interface.

I think it would be fun to have a global PicAxe server and PicAxe spread all over earth to send data to that server. An fun project would be to create a weather network (I know, it's already done...).
 

hippy

Technical Support
Staff member
DynDNS and others will get a named pointer to your network as a whole ( your home IP address ), and one could then access each PICAXE by a separate number, much like a person's name may find a zip code for a block of apartments, and a following number would identify the apartment within that block. It's this turning numbers within the block to names and vice-versa which isn't currently defined and would be PICAXE network dependant.

Theoretically, one could run a DNS-type server on their network, so the infrastructure the internet already has sorts out dracula.dyndns.com to a location and the local DNS resolves picaxe1.dracula.dyndns.net to a further PICAXE number but it's not an area I'm familiar with.

Having named PICAXE nodes is really just icing on the cake, maybe necessary for human simplicity, but we can all deal with raw numbers just as we do with telephone numbers to start with. Once the bottom level is sorted, then higher levels can be added on to make things work more easily.

Key is what UDP packets mean on a PICAXE network, what does the data represent, and how do we know what the data represents, rather than how they get from here to there. What they mean is fundamental to the network whether carried by ethernet or serial.
 
Speaking to the static IP address situation, there are some unusual conditions which may preclude access to the WLAN or outside internet.

Being in a very rural US location, the only option outside of dial-up is a local wireless ISP. While the ISP advertises free static IP's, they are only available to the ISP's home (office/town) radio/attenna.

Being in a town that is 18 miles away, the local radio/antenna traffic is then routed thru a leased line(also a radio/antenna) from the local school district back to the ISP's home office. This part is significant, because not even DyDNS will work because of this arrangement.

So far the ISP has neglected (perhaps refused) to give up a static IP address. I think he wants a $25 setup, and $15 a mo. fee for a web service. He has seen the measly XPORT, and knows it is for hobby purposes only. Booo Hooo!
 

hippy

Technical Support
Staff member
Not having access to static IP's is quite common, especially when one considers there are only 4 billion in total, huge chunks ( multi-millions of addresses ) of those have been allocated en-block to various bodies, and ISP's have relatively few to hand out.

It's estimated that 40% of possible IP addresses are not available because they are 'hoarded' by those who have rights to them but are unlikely to use them ( governments and academia mainly, particularly US-based ).

IP4 is predicted to run out of IP addresses between 2008-20013. IPv6 is a partial but not complete solution.

Until then, dynDNS and similar are the best solution and work quite well in my experience.
 
I would like to try the dynDNS for the XPORT, but was told during a conversation by the leased line administrator that it wouldn't work. Not knowing the network and router side of things, I took his word for it.

Maybe I will try the dynDNS service anyways, just to verify whether that information is correct or not.

I here you on the fixed IP adresses. Supposedly the IPv6 with the 128 bit or 16 byte address scheme would give us 2^128, whatever that number is.
 

moxhamj

New Member
I'm wondering if this can be done with email rather than UDP? Stelios says the modules can send emails, so there is no reason they can't send me an email. I can act on that email, or set up an auto forward. But how do these modules receive emails?

For me to receive an email, the email arrives at my ISP and then when I start my email program it gets sent to me. The ISP offers me an email account with my internet connection. With these modules, do they log into an ISP to get emails or do they receive them directly (always on)? And if they get emails directly, they are behaving more like an ISP than an end user. And ISPs have permanent static IPs. So now I am hopelessly confused about how these modules actually do receive emails if they don't have a static IP address. Stelios - Help!
 

Brietech

Senior Member
I don't believe they can receive emails. I think they can only send them. They can send and receive UDP packets, however.
 

moxhamj

New Member
You are correct: <A href='http://www.avcomsmt.com/SimpleLan_manual.pdf' Target=_Blank>External Web Link</a>

So it comes down to UDP packets.

Actually, could some kind soul explain to me how IP addresses work. If I go to a website and ask for my IP address it gives me 4 numbers 121.45.30.211 which are the IP my ISP has assigned to me. But if I do an IPCONFIG on my PC it gives me the 192.168.1.n number my router has assigned my PC. Is the complete address of a PC on this network an 8 digit IP? Or, more specifically, how does a message coming into my computer know which of the n computers on my LAN to direct the message to? I am guessing that the router does this job and changes the IP header from my external IP address number to a number that works internally on the LAN.

An IT expert friend of mine went and bought a block of 172.x.x.x IP addresses and hands them out to friends he wants to include on his VOIP network. Now I am beginning to understand why he was so insistant on changing my whole office network to his static numbers.

There are solutions that change 192.168 numbers to static IPs for VPNs (eg Hamachi, which uses 5.x.x.x numbers), but even then I have not got Hamachi to work reliably. I suspect this may support the evidence that dynamic IPs are a pain to work with.

But I don't think paying for a lease on an IP number for a PIR sensor is really practical either. For my home network I think I'll stick with slow serial for the moment...

Edited by - Dr_Acula on 14/08/2007 03:34:18
 

Brietech

Senior Member
Each ISP has a pool of IP numbers allocated to them. Let's say they are lucky and have the entire 123.x.x.x block. Now, your computer (or router) dials up to them (or if it's cable or DSL, connects), and the ISP's DHCP server will &quot;dynamically&quot; give you one of the IP addresses in its pool. They do this so that (especially with dial-up) can have far fewer IP addresses than customers, and it all still works out fine.

Once the computer or router (router, in your case) has an IP address, it is free to interact with the any other destination on the internet. A router can additionally use something called NAT (&quot;Network Address Translation&quot;) to make up fake &quot;sub-addresses&quot;, that usually fall in the 192.x.x.x or 10.x.x.x range (designated &quot;junk&quot; addresses in the IP space), and only &quot;exist&quot; within your home network.

Your router &quot;translates&quot; between your one &quot;real&quot; IP address and all of the fake sub-addresses underneath it, probably via a look-up table or something.

Hope that helps =)
 

moxhamj

New Member
Ah, that makes sense. Although it also makes it complicated. It should be morning soon in Athens - hopefully Stelios will have an update.
 

craigcurtin

Senior Member
Just to expand on what Brietech said

The following addresses are assigned as &quot;private&quot; non-routable internet addresses i.e. your router is not meant to send them out to the Internet and definitely nothing upstream will forward them on if it does

192.168.0.0 with subnet 255.255.255.0
10.0.0.0 with subnet 255.0.0.0
172.16.0.0. with subnet 255.255.0.0

The most common in use on home networks (and the majority of small business is 192.168.x.x
as this gives a good mix in terms of numbers of IP addresses (255) per subnet (255) and is the easiest to understand when using standard subnet masks

regards
Craig
 

steliosm

Senior Member
Goodmorning everyone.
Dr_Acula, as Brietech said, the module is able to send emails and not receive. I see you are confused on networking issues. On the other hand you have just gave me a good idea: Hamachi is a perfect little tool to easily create secure VPNs. Since the protocol is defined with a central server accepting connections from clients, there is no need for static IPs. It should be very easy to privately (and securely) monitor your home. I'm willing to do some test (home - office) and see how it goes.

I haven't had much time to test receiving UDP packets yet, I hope I can find some time tonight. One thing that worries me is that the PicAxe will be doing a serout (to request data from the module's register) and then a serin. The problem here is that I need to know the exact number of bytes in the UDP packet or else I'm either going to read a part of the packet or I will get stack in serin state.


Edited by - steliosm on 14/08/2007 08:53:44
 
I guess you guys must have already discussed this, but: The picdem.net processor can be programmed for TCP/IP or UDP. The picaxe.net is the same thing, but with a physically smaller processor. What about reprogramming the IP core on the device so you can nicely interface it with a picaxe?
 
Top