Dexter Industries WiFi and RS485

This is where you talk about the NXJ hardware related topics such as the brick, sensors, LEGO pieces, etc

Moderators: roger, 99jonathan, imaqine

Re: Dexter Industries WiFi and RS485

Postby skoehler » Thu Mar 01, 2012 12:14 pm

mattallen37 wrote:
jdc2106 wrote:...there's always the possibility that a response comes to the module at exactly the same time as a signal is going out to the module, and to handle that, I think you would need hardware control (someone correct me if I'm wrong).

Without programming the serial handler on the Wifi module, yes, you would need HW flow control to totally eliminate collisions. Either that, or a full-duplex UART line between the NXT and the Wifi module.

Actually, I saw recently that it should be possible to re-program one of the ARM cores in the Wifi module used for the DIWIFI. Apparently it can be programmed to use UART, SPI, or I2C. That means that in theory, you could re-program it to only transmit a message upon receiving a request over RS485 (a master-slave relationship). That should totally eliminate the problem... at the cost of a new version of the DIWIFI (since the programming pins are not broken out on the current HW version).

I'm not quite sure, but I believe that the ARM core must also run a TCP/IP UDP/IP stack. It won't be an easy task to modify the firmware, unless the manufacturer actually provides the sources or binaries of that.

Also note, that the datasheet mentioned a firmware upgrade command. The firmware image will be downloaded via HTTP from a given URL.
skoehler
leJOS Team Member
 
Posts: 1110
Joined: Thu Oct 30, 2008 4:54 pm

Re: Dexter Industries WiFi and RS485

Postby mattallen37 » Thu Mar 01, 2012 6:25 pm

The WIFI module uses two ARM cores. One is for handling the IP stacks, and one is for application interfacing. I think GainSpan offers a SDK for people who want to modify the FW on the app. core. There is some more information about the module on the SFE product page.

Edit: Okay, I though it would probably be through JTAG like most ARM processors.
Matt
mattallen37
Novice
 
Posts: 28
Joined: Thu Mar 03, 2011 7:45 am

Re: Dexter Industries WiFi and RS485

Postby skoehler » Thu Mar 01, 2012 9:24 pm

mattallen37 wrote:The WIFI module uses two ARM cores. One is for handling the IP stacks, and one is for application interfacing. I think GainSpan offers a SDK for people who want to modify the FW on the app. core. There is some more information about the module on the SFE product page.

Have you found information on the protocol that the two arm cores talk to each other? Or maybe an API documentation of the SDK?
skoehler
leJOS Team Member
 
Posts: 1110
Joined: Thu Oct 30, 2008 4:54 pm

Re: Dexter Industries WiFi and RS485

Postby mattallen37 » Fri Mar 02, 2012 1:28 am

No I haven't. I haven't really looked into it much at all.
Matt
mattallen37
Novice
 
Posts: 28
Joined: Thu Mar 03, 2011 7:45 am

Re: Dexter Industries WiFi and RS485

Postby tatranky » Thu Mar 22, 2012 7:34 pm

Hi,

If anyone is interested, I've created a driver for the WiFi sensor that implements some of it's features... I've included 3 examples; DNS lookup, Ping and WebServer

You can get the driver and the examples here: http://dl.dropbox.com/u/2059788/DexterW ... S_v0.1.rar

\Lasse
www.BrickIt.dk
User avatar
tatranky
New User
 
Posts: 6
Joined: Mon Aug 17, 2009 6:56 pm
Location: DK - Aalborg

Re: Dexter Industries WiFi and RS485

Postby Aswin » Thu Mar 22, 2012 10:00 pm

What language is this driver for?
My NXT blog: http://nxttime.wordpress.com/
Aswin
Active User
 
Posts: 122
Joined: Tue Apr 26, 2011 9:18 pm
Location: Netherlands

Re: Dexter Industries WiFi and RS485

Postby skoehler » Thu Mar 22, 2012 10:11 pm

Aswin wrote:What language is this driver for?

leJOS
skoehler
leJOS Team Member
 
Posts: 1110
Joined: Thu Oct 30, 2008 4:54 pm

Re: Dexter Industries WiFi and RS485

Postby A.Soriano » Wed May 30, 2012 9:15 am

Hi!
Thanks for the lejOS examples.
I'm trying to connect NXT with DI wifi to PC. I can ping, it works, I can recieve from PC to NXT, but I've problems sending from the NXT to PC any String.

My Code in NXT to send to PC:

Code: Select all
                wifi = new DexterWifiSensor(DexterWifiSensor.BAUD4_115200);
      String resp=wifi.connectWLAN(SSID);
      if(!resp.startsWith("OK:"))
         return;
      int IDServerTCP=wifi.startTCPServer(port);
      if(IDServerTCP==-1)
         return;
                //TCP Server created succesfully
      String input = wifi.readFully(true);
      int i = input.indexOf("CONNECT "+DexterWifiSensor.intToConIDChar(IDServerTCP));
      if(i<0)
         return;
                //Found incomming connection:
      int clientID = DexterWifiSensor.conIdCharToInt(input.charAt(i+10));
      wifi.sendTCPData(clientID, "Some String");
      Delay.msDelay(100);
      wifi.closeAllConns();


NXT say "sent", but PC doesn't receive anything.
Some idea?

Thanks a lot,
Regards,

A.Soriano
A.Soriano
New User
 
Posts: 15
Joined: Fri Apr 08, 2011 10:14 am

Re: Dexter Industries WiFi and RS485

Postby skoehler » Wed May 30, 2012 9:38 am

The driver is buggy. Neither does it treat incoming ESC-sequences correctly when reading nor does it wait for the acknowledgements of the ESC sequences it sends.
We're working on a proper driver that's somewhat well tested and doesn't have these issues.
skoehler
leJOS Team Member
 
Posts: 1110
Joined: Thu Oct 30, 2008 4:54 pm

Re: Dexter Industries WiFi and RS485

Postby Docta_J » Sun Dec 16, 2012 8:22 pm

Hi,
I am working to implement an HTML5 websocket server for the NXT in leJOS. I am using the Dexter Industries WIFI sensor with the dk.brickit.drivers package as the basis for my project. (thanks to Lasse <at> brickit.dk for the code!). Has anyone created a websocket server implementation already? are there any updates to the V0.1 brickit drivers?

John
Docta_J
New User
 
Posts: 10
Joined: Sat Jul 07, 2012 3:15 am
Location: North Dakota, USA

Re: Dexter Industries WiFi and RS485

Postby skoehler » Tue Dec 18, 2012 2:34 pm

The design of the Dexter Wifi has issues. The bottom line is: It doesn't work reliably. Full stop.

This is not a software or driver problem (even though the driver that is in leJOS is currently pretty bad. Brian is working on a better one right now). It is a hardware problem, and while Dexter Industries tries, they have not come with a solution yet.

The problem is, that the NXT has rs485 (half duplex) while the wifi adapter is designed for rs232 (full duplex). Data corruption will happen. Especially if the Browser sends a HTTP request while it is reading the HTTP response to a previous request. One has to be EXTREMLY careful to avoid that scenario. Also, TCP connections must not be used in full duplex mode, i.e. one must never write data, while you're expecting to receive data.
skoehler
leJOS Team Member
 
Posts: 1110
Joined: Thu Oct 30, 2008 4:54 pm

Re: Dexter Industries WiFi and RS485

Postby Docta_J » Mon Dec 24, 2012 6:09 am

Thanks for clarifying the situation. I'll look for another solution for my project. I am interested in helping to improve the Lejos driver. How can I get involved?

John
Docta_J
New User
 
Posts: 10
Joined: Sat Jul 07, 2012 3:15 am
Location: North Dakota, USA

Previous

Return to NXJ Hardware

Who is online

Users browsing this forum: No registered users and 1 guest

more stuff