[HeRos] WiFi finally working properly

Hi everyone!

The WiFi is finally working properly! Turns out some of the messages I transmitted via WiFi were corrupted because the RTS and CTS pins of the USART weren’t configured properly. With Sam’s help I found out how I was supposed to configure them and it instantly worked a lot better!

Unfortunately the data rate hasn’t improved a lot. I managed to get to 1Mbps at the most with the UART set up with a 1.2Mbps baud rate. It should be enough to stream JPEG video but it won’t be very pretty! We’ll know more when Rico has the camera working.

I also set up the Android app to show a JPEG input stream but I can’t test it until the camera works! Tomorrow, while I wait for the camera to be ready, I will focus on incorporating Charles’ IR code with WiFi in order to completely control HeRos through WiFi: move, shoot, and get shot at.

Until next time!

[HeRos] Wifi again!

Hi everyone!

Today I worked on WiFi, again… Specifically I cleaned up my code and added it to the master branch which means it is ready for a demonstration!

Some issues remain though: the data rate is still unstable, and a little weird. Errors in transmitted messages make the data rate look higher than it actually is, and will make it impossible to stream video, so I have to figure out where they come from (UART, WiFi module, ChibiOS, …)! That’s going to be my goal tomorrow!  In any case HeRos manages to transmit at about 120 000 bytes per second with the UART configured at 921600 bits per second, so that’s pretty good. The next step will be to boost the UART baud rate and be able to stream video at an acceptable framerate and resolution! Rico is working on the camera and we’ll soon be able to test streaming. And Charles has made some good progress on IR so we’ll soon be able to add the shots control and detection via WiFi. The project is really coming along nicely, it will be fun to play with our HeRos!

Until next time!

[HeRos] Android app and WiFi

Hi everyone!

As requested, here is a video of me controlling the HeRos with and android app via WiFi!

Until next time!

[HeRos] Streaming via WiFi

Hi everyone!

The WiFi works very well: I’m able to connect to the HeRos with a minimal Android Application that I coded and I can then control the movement of the robot through that. To test the throughput of the wifi module in streaming mode, I’ve implemented a simple java application on my computer that connects to the HeRos and measures the data rate. I’ve been able to achieve 180KB/s which is cool but may not be enough for our video, even in JPEG. In streaming mode the wifi module directly connects the UART with the WiFi, so the limiting factor for the data rate is the baud rate of the UART. For now I’ve been able to make it work at 921600bps. The wifi module theoretically can work at up to 5,25Mbps, but I haven’t been able to make it work with the STM32F427 yet. I will have to figure out what maximum baud rate I can configure for the STM32 and get it to work well with the WiFi module.

So there’s still work to be done!

Until next time!

[HeRos] Control through WiFi!

Hi everyone!

We can now control HeRos through WiFi, each movement being triggered by one keystroke:

 

Until next time!

[HeRos] Control through WiFi and dead processor

Hi everyone!

Today was a good day! Until it wasn’t…

It was good because I managed to get the WiFi working to the point that I could control the movement of the HeRos via WiFi remotely from my computer! I use telnet to talk to the module. I still have to make my java implementation work because it doesn’t, I don’t know why. It should listen to the UDP packets sent regularly by the WiFi module, containing its IP address, get that address and open a TCP socket in order to talk to the module. But I can’t get the program to receive an UDP packet… I’ll have to find out why tomorrow!

Then it wasn’t good anymore because at about 18h30 the PCB I was working on suddenly didn’t work anymore… But I wasn’t doing anything special that I hadn’t done many times in the afternoon, so I didn’t understand why it didn’t work anymore. So I asked Alexis if he had any idea what was going on, and after some investigating on his part, it turns out that the processor is dead. The cause is probably the reset pin of the Pololu, which we connected to an output push-pull GPIO on the STM32F427. Since the STM32 works at 3.3V and the Pololu at 5V, when we put the GPIO to 1, 5V could have passed through the STM32 and burnt it! So we still have 3 good PCB, and we changed our pin config so that the corresponding GPIO is an input instead. Hopefully that was the only problem!

Until next time!

[HeRos] WiFi, Pololu and Board

Hi everyone!

Today was mostly about WiFi! I got to know our WiFi module (AckMe AMW006) with its development board. I can now configure it to be a TCP server and to be used in stream mode (everything from the UART gets sent through WiFi and vice versa). I also coded a TCP and UDP client on the computer in Java. Why in Java? Because it will be easy to transfer into an Android application! I haven’t been able to test all this yet as our first complete PCB was just ready this afternoon. We have to test all the components one after the other and check if there are any issues. That will be tomorrow!

Until next time!

 

[HeRos] 100% HeRos

Hi everyone!

Today was 100% about HeRos! We started by defining our board.h file for our PCB, which isn’t complicated, but takes some time. Then I worked on setting up the basic functionalities of our HeRos: blinking leds, serial over USB, and Pololu control. The leds and serial over USB were just about transferring what we had done in the practical work on STM32. I had already coded some controls for the Pololu and I just had to implement them for our HeRos, in order to control them via the keyboard of the computer.

It will be fun to test all that and what Charles and Rico have worked on tomorrow on our PCB.

Until next time!

Challenge!

Hello everyone!

Yesterday was challenge day! It was long, it was hard, and… What am I talking about?! :p

Anyway, I started out ok, being able to receive a request and resend one within 2 seconds pretty quickly. But then I got stuck on something very stupid, for hours… Turned out I couldn’t do it two times in a row, the second one wouldn’t work. So, not knowing if it would be important for the next steps or not, I decided to fix the issue.

The problem was with the http_request buffer that got overwritten and contained more info that I wanted at the beginning of the second try. So when I sent it to the server, it wasn’t happy. After some time (meaning 1h) trying to fix my way of doing things, it didn’t work any better, so when Sam said that those who hadn’t yet managed to send two requests in 2 seconds had to implement it using mailboxes, I thought to myself: ok, you’ve been stuck on that for hours, maybe that’s the solution. So I started from scratch and implemented a mailbox. It was probably a cleaner way than what I was doing before, but as it turns out, when it was done and worked, I still had my buffer problem…

The solution was very, very stupid, as it often is: I finally asked Sam how I could fix my buffer problems, he told me that I shouldn’t have one because the buffer should get overwritten at each step with the string I want (ending with a null character) and the rest of it shouldn’t matter because it shouldn’t get sent to the server since it was after the null character. And there you have it: the problem was with a line of code I had copied from an lwip example earlier this week that sends the request to the server, using sizeof(http_request)… instead of strlen(http_request)… I think I don’t have to tell you how angry I was at myself at this point, because changing one word in my code made it work perfectly, instantly, and would have made my previous way of doing things work as well! So to sum up I lost about 4h on 6 f**king characters! \o/

Then I went on to the next steps and got to the LCD screen, but the challenge was over before I could make it work and I’ve since then improved it but I can’t test it (we don’t have the screens any longer).

So this challenge was… interesting! And very, very frustrating! But I should have found my mistake way earlier, or simply asked Sam or Alexis why it wasn’t working properly, I guess my stubbornness got the better of me! I wish I could have made it to the last steps, the maze seemed like a fun thing to implement.

Anyway, now it’s all about HeRos for a month and I think we’re ready to handle it using ChibiOS! 😉

Until next time!

Sorry for the long post, here’s a potato:

Sainte-Patate

[HeRos] Components and TP STM32

Hi everyone!

Today I finished the work on the STM32 card: I added the support for a shell which makes it more interactive and easier to debug. Ready for tomorrow’s challenge!

For HeRos today we had to choose the components that will connect to the PCB (not soldered on it).

That’s it for tonight!

Until next time