SimpleLan and PicAxe

moxhamj

New Member
I have never used serin without qualifiers (ie "ABC" or whatever at the beginning). Without a qualifer the serin could be reading anything and it will get very hard to debug. Sometimes I've managed to capture the waveform on a CRO and read off the ascii characters directly. How much control do you have over the output of the module?
 

steliosm

Senior Member
I'm afaid I don't have any control at all. The qualifiers do not work either, since I don't receive the proper characters.

Eg. instead of "1234" I receive the ASCII values: 136, 38, 83, 248.

Is anyone thinking of another experiment I could try?
 

steliosm

Senior Member
I don't know that yet. I sent an email at Scott (Avcom) but I assume there is no delay.

If PicAxe takes awhile to move from serout to serin I'll be missing a few bits of the start, is that correct? I mean if that is correct I could check if my bits are shifted.
 

lbenson

Senior Member
>you are actually telling SimpleLan where to send the message when you are constructing the message.

Oh. How embarrassing. Don't know how I missed that. I was looking for the address in the UDP message itself. Thanks.
 

hippy

Technical Support
Staff member
<i>serout 2, t2400, (&quot;!AT0WBM:This is PicAxe!&quot;, 13)
serout 2, t2400, (&quot;!AT0WBI:192.168.2.1&quot;, 13)
serout 2, t2400, (&quot;!AT0SB&quot;) </i>

Okay - I'll admit that I may not have been paying attention and I hadn't twigged it was quite that simple from a PICAXE to send UDP. That is mighty impressive and easy to use.

For an 08/M getting short on memory, one could use two 08/M's diode mixed with the master telling the slave to send the header, then when it's done, send the data it needs to send.

<i>serout 2, t2400, (&quot;!AT0R20&quot;, 13)
serin 3, t2400, b0 </i>

This could be where it starts to get PICAXE un-friendly. If the SimpleLan sends before the PICAXE has initialised its SerIn and is ready for a byte then there will be all sorts of data corruption.

One solution, like the earlier Master-Slave suggestion - Have the slave told to send the message and have the master ready for SerIn as soon as it has told the Slave to send. That way the Master will be ready for the data by the time the slave completes. In fact, you could have the slave just send the CR (13) after a short delay ...<code><pre><font size=2 face='Courier'>
Master:
SerOut 2, T2400, (&quot;!AT0R20&quot;)
Toggle 1 ' Kick Slave
SerIn 3, T2400, b0
Return

Slave:
Do
If pin1 = 0 Then
Do : While pin1 = 0
Else
Do : While pin1 = 1
End If
Pause 10
SeRout 2, T2400,(CR)
Loop </font></pre></code>
 

steliosm

Senior Member
Hello Hippy.
Thanks for the idea. It's a nice trick just to test things. I'll set a second picaxe to be in serin state and the first sending read requests in predefined intervals just to check what is happening. Unfortunately I'm at work right now, so I'll have to wait till morning to check it out.

On the other hand this module is basic stamp 1 friendly. The basic stamp has a 4MHz clock and is rated at 2.000 instructions/sec. How much faster can this be from PicAxe?
 

steliosm

Senior Member
Hello everyone.
I just run the test with 2 picaxe chips, as Hippy suggested, and it seems to work fine.
So, probably the 08m is a bit slow for the SimpleLan. I'm afraid I don't have an X1 chip to run some tests. I guess the X1 clocked at 20MHz should be up to the job.

I'll send an email also to Avcom and see if there is anything we can 'poke' to set a small delay before the module sends the data back. Nay be a hidden RTS (Request To Send) pin?
 

hippy

Technical Support
Staff member
Glad you got it working if not ideally configured. I'm surprised that if it works with a Basic Stamp it doesn't work with a PICAXE. If you aren't already, you could try running at 8MHz with T1200 and see if that improves things.

At least with the low cost of a PICAXE-08 it's not the end of the world if one has to be added to delay the CR sending if SimpeLan cannot do it.
 

steliosm

Senior Member
I already tried the m8 option but I get wring results as well. I even pushed the speed of the serial to 300 but I couldn't get it t work properly.

Yes, the cost of an extra 08m is very small but then again you will have to implement a communication between the two 08m's and also loose program memory. Also the modules should be called 'Lan' instead of 'SimpleLan' :)

Maybe the guys at Avcom can provide a special PicAxe firmware with a few ms delay :) To be fair is the module does a great job in letting picaxe send out information either by Web or E-mail or UDP.

Also, a sa follow up on a previous question I had, the module draws ~110mA.

Edited by - steliosm on 18/08/2007 15:41:33
 

hippy

Technical Support
Staff member
<i>the cost of an extra 08m is very small but then again you will have to implement a communication between the two 08m's and also loose program memory. </i>

Should be able to get away with an 08 if using no more than 2400 baud. The protocol is as simple as just toggling one 08M I/O line ( which admittedly may be in short supply ) and the code memory to toggle the I/O line exactly the same as including the CR in the SEROUT if using Pin 0 or Pin 1.

I know we all tend to do it ( including me ), but when spending $10's on an interface, it can be false economy to skimp with the low spec PICAXE's, and if you can offload any AT commands to the 08, that frees up 08M memory as well, which could prove useful even if a delayed response does get added.

I'd consider a 14M and an 08 so there's plenty of I/O for use and for 08 control, although I'm a little cautious with that recommendation these days with the issues being raised on the 14M.

But, whatever you do, I'll still be interested to hear how it goes.
 

manuka

Senior Member
FWIW &quot;Make&quot; has a link to a Fon based cryptonoid f.i.c.s. - Fonera Internet Controlled Switch =&gt;<A href='http://cryptonoid.blogspot.com/2007/08/fics-fonera-internet-controlled-switch.html' Target=_Blank>External Web Link</a>
 

steliosm

Senior Member
Nice little project. The old version of this router costs 35 euros. Not very expensive if you ask me.

As for the simplelan, I'll give it a try with an X1 part (when I get one) and also talk with Avcom to get a better understanding on how fast the module transmits the data.
 

moxhamj

New Member
Re Avcom, I wonder if it is worth copying and pasting this entire thread to them? Just to show that lots of people are very interested in this device but that getting it working is not quite as simple as it seems. They may be able to suggest a tweak to their software.
 

steliosm

Senior Member
I'll have a talk with them and see what could come out of this. It is a good change for them, in my understanding, to break into the PicAxe market.

What I would propose is first for us to conclude on what would be ideal for SimpleLan to change in order to work fine with PicAxe. I think a small delay (10-20ms maybe?) between getting a read request and sending the reply back should work. What do you think?
 

hippy

Technical Support
Staff member
I'd expect to only need a few hundred uS delay, so that could be suggested for implementation as 0-255 x 10uS ( 2.5mS max ) or 0-10 x 100uS ( 1mS max ).
 

moxhamj

New Member
A small delay is only a few lines of code from their point of view. One can think of all sorts of complex protocols (put a line high before sending data etc) but a delay is much more likely to get done. The only scenario where it falls over is when the picaxe somehow gets stuck in a serin and then never asks for more data. I wouldn't trouble Avcom about that scenario though as it is a problem peculiar to picaxes. (The problem comes up in a serial router design and I solved it with a second picace monitoring the first picaxe and resetting it if it doesn't detect 1Hz pulses for a while).

I guess the sales pitch to Avcom is that adding that small delay potentially opens up the picaxe market.
 

steliosm

Senior Member
Dr_Acula exactly my point. A small delay shouldn't be too much to ask compared with the revenue they will have. SimpleLan will be fully PicAxe compatible and will cost less than any other networking module in the market. I hope I have some more news to post tomorrow concerning the emails to Avcom.

I'm still glad that the module works out-of-the-box for the rest of the functions.
 

MORA99

Senior Member
My simplelans has arrived :)

How did you get them to work with just a picaxe, the docs say I have to use that program to set it up, but which ip does it take as default so I can find it ?

Sofar I have just applied power and ethernet and tried to find it with no luck (4.0V didnt see any datasheet on the cd).



[EDIT]Fixed: The secret ips are in &quot;crossover&quot; pdf, and my laptop didnt work with it for some reason.
But my other computer could configure it, so no sweat.

Still didnt find a voltage range though, and would be cool if they could be programmed from the picaxe (with ip settings).

Edited by - MORA99 on 21/08/2007 16:02:41
 

steliosm

Senior Member
MORA99 I'm afraid you need to program them through the windows application. Using a crossover cable is the easy way to 'discover' the SimpleLan module. Also, the default settings is to use DHCP for IP autoconfiguration is your network has that service.

What do you mean a 'voltage range'?


 

MORA99

Senior Member
Voltage range = what voltage it can accept?
Like picaxe it probaly has a range where it will work, but since its made for bs 5V is probaly good.

For some reason my laptop cant see the simplelan in the program, but it can on the website, and I have enough computers that can program them that one time, but for a production its not practical that each item has to go past a configuration, maybe they only aim for hobby use.


I have one on a 18X for now, dont have a free X1 unit but some are on their way :)
 

hippy

Technical Support
Staff member
According to the manuals the voltage is 5V.

<i>for a production its not practical that each item has to go past a configuration, maybe they only aim for hobby use. </i>

It is feasible ( if a little complex ) to have each unit determine what's possibly an unused IP address on a LAN but then it gets hard to find which unit has which address so you're loading the right files and talking to the unit you think you are. How would you know which IP address represents the one which reads the temperatures and which represents the one controlling the fans ? It's the same problem when all PC's on a LAN use DHCP.

Even with a unique MAC address ( I presume each is unique ) you'd still have to do some configuration unless you only had one device on the network.

It would be possible for the devices to auto-configure using BOOTP and TFTP but then you'd have to configure a server to handle that, and that's probably more complex than what is on offer.

It's no so much that it's for hobby use, but you get what you pay for.
 

MORA99

Senior Member
I was more after a way to configure it without the use of their program, trough telnet or from the picaxe.

But its fine, for 30$ this is pretty good value :)
 

steliosm

Senior Member
if you don't want to use the windows application you are limited to DHCP autoconfiguration and no file transfers.

If you only use them to send emails/UDP packets I guess it's OK to go with DHCP. You just going to have to do the 'identification' part in the PicAxes.

If you need to browse them and send UDPs then you have to use the application.

I think I have to go for the 28X1 chips.
 

MORA99

Senior Member
Yes, X1 parts atleast for the timeout on serial.
Also 40X1 is very close priced to 28X1, although its BIG, hehe.


did you get readback of variables to work with the standard 4mhz clock ?

SEROUT 0, t2400,(&quot;!AT0R75&quot;)
SERIN 0, t2400, b0

that gets stuck at serin even when 75 is filled from the website with atleast a byte.
 

steliosm

Senior Member
It only works if you use two chips, one for sending the AT0Rxx command and one waiting at serin to receive it. This is what Hippy suggested as a test and it worked.

The X1 should be able to do it without problems, especially with an external oscillator.
 

moxhamj

New Member
Do two 08's work out cheaper than an X1? I guess both solutions would be valid. Am eagerly looking forward to a working prototype demo of this SimpleLan!
 

steliosm

Senior Member
I guess it depends where you get your chips from. I was paying 4.2&#8364; when the chip was sold at 2.6&#8364; from TechSupplies (1.76GBP).
Since I like simple things I would rather use a simple chip to handle all the network communications.
I'm still talking with Avcom and may be we can work something out.

Edited by - steliosm on 22/08/2007 16:58:21
 

MORA99

Senior Member
bah ofcause I forgot the resonator, so I can only run the x1 at m8, dont think thats enough.

Anyway is the udp port and http port locked, asin impossible to change from the default ?

Many routers cant differ on the wan and lan side ports, so that would limit to one per public ip if it is to be contacted from the outside without starting the comm it self.


Pretty neat the simplelan will handle all the webserver code, so an external program can just post a get command, and picaxe can read it when it has time in its loop, instead of having to read when its written.
Same with udp I guess, although theres just 1 register so have to be read before the next comes in.
 

steliosm

Senior Member
I'm afraid you cannot change the listening ports for UDP and
Most probably you are limited to one simplelan per real IP, that is if you want incoming connections. On the other hand, if you need to privately access your simplelans (eg. take temp readings from a remote building) you could use Hamachi and create a vilrtual lan. You will need, though, a pc to run hamachi on.
 

MORA99

Senior Member
Or a computer/server that will recieve udp on 22002 and broadcast it onto the subnet, sinc ethey reply on the broadcast from the simplelan program, they probaly do on others too, or a bit more complex, make the first byte of the message point to a picaxe which gets a udp message with the contens.

Maybe they will make it possible to change the ports in the future.

Have you found any information on what the remaining pins can be used for ? (P0,2,6).
 

steliosm

Senior Member
No, nothing. I presume those pins are there for programming the chip maybe or connecting it to an in-circuit debugger.

I'm afraid I didn't have any news for the past 3 days from Avcom. I want to believe that I was as clear as possible when describing the issue to them.
 

MORA99

Senior Member
I got my first Simplelan project &quot;done&quot;.

A 28X1 with no external resonator (running at 8mhz) reads 8values from simplelan to adjust a relay board.

I read each 3 times and compare if they are the same, seemed like the lazy way to be sure.

The code is fairly long, so wont post it here.
http://elektronik.codebin.dk/index.php?module=pagemaster&amp;PAGE_user_op=view_page&amp;PAGE_id=17&amp;MMN_position=17:8

Im not sure the eeprom code works yet, but the simplelan part works fine.
 

steliosm

Senior Member
I'm impressed! You managed to read data off the simplelan as it is!?!
I couldn't get that to work with 08M even when it was clocked at 8MHz.

 

MORA99

Senior Member
I couldnt either with a 18X, but a 28X1 at 8mhz works, and it has timeout option so it wont lockup.

simplelan is running at 2400baud (t1200 at 8mhz)

Edited by - MORA99 on 27/08/2007 23:28:13
 

rhaseman

New Member
I wondered if anyone had considered the Lantronix Xport direct as a possible solution for networking the picaxe? While it does not have a built-in webserver it does support RTS, CTS, and DTR which might make it possible to use handshaking to control the interface to the picaxe. At $28.00 each in single units it is in a similar price range to the simplelan. The biggest problem I see using it is the strange 2mm pin spacing it uses - won't go into a standard socket or prototyping board.
I have used it's big brother - the UDS 100, and it works very well for serial to ethernet interfacing.

Rick
 

steliosm

Senior Member
The Xport is a good alternative if you need to send data out. SimpleLan works, mainly, the other way around. You connect to it and you see your data. Plus, you can have an email based alerting system.
AFAIK my second network module will be another SimpleLan paired to an 28X1 chip.
Just out of curiosity, where did you find the Xport selling at 28USD?

Edited by - steliosm on 28/08/2007 22:13:11
 

rhaseman

New Member
The Lantronix Xport Direct is a more limited version of the standard Xport unit. The website www.gridconnect.com has single units for the 28 USD price (not the development kit - just the Xport Direct with windows software). I have been studing the documentation for the unit but don't have any hardware currently in hand. From what I can tell it should be possible to connect to the Xport Direct from an outside location and request data from the picaxe. The unit does not have a webserver so you could not go the webpage route for data collection but you should be able to cause the picaxe to send a set of serial data which the Xport Direct would insert into packets and send to the remote ip address. I may be wrong but it does seem possible with this unit.
Rick
 

steliosm

Senior Member
The Xport is able to do TCP connections to remote locations. I think the same goes for the Xport Direct. This way it's pretty simple to 'send' your data to a Web Server somewhere on the Internet and read your data from there.

I have a similar project, although not using Xport, which sends data to a server somewhere on the Internet. Have a look here: <A href='http://www.steliosm.net/home_monitor.html' Target=_Blank>External Web Link</a>
 
Top