Version 3.3 is out and should work just fine with all version of ROBOTC for NXT of at least 3.59. I still need more testers for the dWiFI and NXT2WIFI sensors, so if you’re keen, let me know. If you’re not keen, then, ehm, don’t.

IMPORTANT NOTICE(S)!This suite will not work with anything less than ROBOTC 3.59, make sure you update your IDE. You can download it here: [LINK].

What’s new?

New driver + example for the Dexter Industries dLight

New driver + examples for the Mindsensors Sensor MUX (includes a disco party)

New matrix math functions, based on the Arduino Matrix library, worth for both floats and longs

Fixed silly bug in NXTCam driver. Thanks fxlj007 for reading through the code!

Complete rewrite of the dWIFI config program and driver, I hope it still works!

Fixed axes in the dIMU driver, I had flipped x and y

Added a simple strtok() function to common.h

Minor costmetic tweaks to test programs

Minor documentation tweaks here and there

For those who like to peruse code, check out dexterind-imu.h for a glimpse of what’s to come

I hope I'm just being a numpty and it's something simple that I'm doing wrong. Thanks for your guidance.

Cheers

Leslie

Wed Feb 19, 2014 4:02 pm

UKTeacher

Rookie

Joined: Thu Jun 20, 2013 4:56 pmPosts: 19

Re: Released: ROBOTC Driver Suite V3.3

Hi again,

I have put the latest firmware on the NXT2WiFi: 130807. This is the information from the firmware updater.Initiating download... Resetting by dtr...ok Searching for bl . Found PIC24FJ256GA106 fw ver. 1.2.10 Waiting for bootloader to be ready...ok Writing flash...ok Download finished

So I think that's good.

I am still having trouble getting a browser to see it and activate it.

It is probably just me not understanding the files and what's in them.

I see there are test 1- 5, and 3 looks a good one. And the nxt2wifi.h file looks great at about line 994. But running it alongside a browser pointed at the NXT2WIFI device gives no joy. Termite shows activity on the device, and the lights go on when on-screen buttons are pushed, but I am still receiving nothing onscreen on Dani's index page.

Normally, I would be quite keen to have a ride on the learning curve and figure it out. But this time I have a real constraint in that I would like to have a bunch of these little gadgets working like this http://www.youtube.com/watch?v=yP41p8Aipw8 by next week. I would very much appreciate any guidance you could give me.

Thank you for having a start at fixing my NXT2WIFI problem. I will confess that the problem was entirely my own ignorance, and I am sorry to bother you with it. Starting one of these up is not for the feint of heart, but I am glad I have done it. I am no expert, but it will be fun to play with. I have got a little custom webserver going now and the robot moves around. I'm a happy gal!

All the very best.

Leslie

Wed Feb 26, 2014 9:32 am

UKTeacher

Rookie

Joined: Thu Jun 20, 2013 4:56 pmPosts: 19

Re: Released: ROBOTC Driver Suite V3.3

Hi Xander,

I wonder if you might help with with some of the commands in your benedettelli-nxt2wifi.h file.

I would like to broadcast the same message to multiple robots. I would like to open a UDP socket on every robot and send data on that socket, so they will receive the same data at the same time regardless of the IP.

I have been using N2WreadWS to read the button values from the webserver and print them to the debug stream which activates the NXT. What I would like to do is make sure these commands go to the UDP socket across a number of robots with different IPs. I see that I can't do that with N2WreadWS.

Are the commands I need:

NX2WUDPOpenClient, orNX2WUDPOpenServer

Then, do I write a command by calling N2WUDPWrite, and read it with N2WUDPRead?

NX2WUDPOpenClient() creates a listening socket.NX2WUDPOpenServer() creates a socket with which you can send.You'll need to use a broadcast address to ensure that all units get the packet. You use the write and read commands as you said.

Keep in mind that UDP is fire and forget and that there's no guarantee that a packet is received. A good way to mitigate this issue is to send the packet out a few times with a sequence number inside the data, so that the client can simply ignore any packets with a sequence number it has already seen.

Would you mind terribly if I were cheeky and asked for an example of code?

My IPs are config'd already. I am confused:

1When in the program do I open the UDP ports? I am using

if(N2WUDPOpenServer(UDPid, UDPport)){nxtDisplayTextLine(1,"UDP Listening");}where UDPid = 1 and UDPport = 222. I suspect it isn't opening because it's not hitting my display text line. I have probably got incorrect values for UDPid and UDPport? What variables would you suggest putting in these arguments?

2And then, do I send a little packet to the NXT on the UDP socket by using N2WUDPRead()? Does that live in the main while true loop?

Thanks so much. Your help is really appreciated. I am sorry I am so clueless about all this.

All best,

Leslie

Sat Mar 01, 2014 12:12 pm

UKTeacher

Rookie

Joined: Thu Jun 20, 2013 4:56 pmPosts: 19

Re: Released: ROBOTC Driver Suite V3.3

Hi Xander,

I have had a play with this, and I suspect my last post was vague. I hope that this makes more sense of my puzzle.

I am still having trouble getting my head around sending a single browser button push to a bunch of robots equipped with NXT2WIFIs on different IPs but the same UDP. I can open a client socket on the robot with this (forgetting about error traps):

RS485initiLib();N2WLoad();N2WgetIP(IPaddress);

Then I open a listening socket:

N2WUDPOpenClient(1,IPaddress,1234)

I have given this socket an ID of 1. All this works find and I can see it on a terminal emulator (Termite).

Then I have an infinite loop waiting for buttons on the browser to be pushed:while (true){ if (N2WUDPRead(1,0)) { <..do something like play a tone, but this is where I want my brick command to live ..> }}

This loop used to have in it:if (N2WreadWS(type, ID, state, value)) { <.. do something like call a command to the NXT based on ID and a switch case ..> }

...for a single robot serving up a browser page with button events.

The latter worked well but not with UDP (as stated very clearly in your driver--thank you!). What N2WUDP--- function do I use to prompt an event from browser to brick?

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum