So I may have done something VERY foolish
I've agreed to a project where a Roomba is controlled via bluetooth. I thought everything was fine and dandy, BUT, I'm not allowed a computer for the end system.
Instead, I'm allowed a Xilinx Virtex II Pro board.
My plan is to buy a bluetooth serial adapter, and buy the iRobot accessory to foster the communication. My hope is that it'll be about as hard as sending messages over a serial port (and I won't have to deal with too much low level socket programming, but if I have to I have to).
My question is, has anyone done something similar to this? Can anyone recommend a tutorial, or a website or a specific product?
I'm aiming to buy these:
http://store.irobot.com/product/index.jsp?productId=2649971
http://overlandresource.com/wp-content/gallery/images/bluetooth-serialconverter.png
Can anyone recommend something better? Can anyone tell me what trouble I'm in for? Really, ANY advice would be nice.
To clarify this project has to be in C and VHDL as C.
You can pretty much just plug and play a Bluetooth module that will do Serial Port Profile e.g. it looks and works like a serial port, even down to RS-232 type connections to the module.
For example, I've played with an RN-42 module by RoHS and it works pretty well. I am pretty sure there are others out there as well.
However, you will have to somehow pair the two ends of the Bluetooth connection. Might involve one end knowing the fixed pin number of the other end. That's going to be down to the modules you end up using.
Don't expect high baud rates either.
So I hope my response isn't too late, but a great tutorial that covers EXACTLY what you are looking for is here:
http://www.robotappstore.com/Knowledge-Base/1-Introduction-to-Roomba-Programming/15.html
It goes over the setup, communication, and basic use of the roomba SCI commands. What's great about the roomba is that you can use any sorta of lanugage you wish to actually handle all your complicated computing, and then just send down your motion commands to the roomba.
Controlling the roomba is pretty easy, just the setup is the most difficult part. The other annoying thing is that the roomba's commands are not in plain ASCII chars, but rather sent in byte form. Once you get over that, its a breeze though.
Hope this helps!
Related
I have an obsolete hardware level/pressure transmitter that communicate with mcu using custom protocol (it appear to be similar to modbus RTU), that hardware comes along with an old commissioning software that works perfectly fine under latest windows, that software contain all communication protocol components that I try to extract and use in something like Arduino to pull data out of transmitter, anyone can help out?
Update - Didn't mentioned above that form of communication here is half-duplex serial communication where master hardware/software query slave transmitter.
Now mentioned to program Arduino mcu to pool data out of transmitter.
What best way of getting readable data out of it?
Again many thanks for all your comments and help!
What you need is called a sniffer. Use that as a keyword and you should be able to find plenty of info here at SO and around the web.
To set the record straight it is actually possible to use Wireshark to sniff on Modbus RTU over serial, see my answer here. If your protocol is similar to Modbus I would start with SerialPCAP.
If you prefer more Windows-friendly solutions you can check these out: 1, 2.
Since Modbus is pretty simple I would say reverse engineering a similar protocol should be, maybe not a piece of cake but just manageable, even if you are not very experienced.
These days when almost everyone is a maker or at least a wannabe, you might want to first take a good look around, maybe somebody else already reverse-engineered that protocol and published it somewhere.
The best tool to analyze a protocol is Wireshark. Run it on the communication link between the Windows machine and the radar. First possibility: the protocol is actually something that Wireshark knows (some trials and errors with the "Decode as" menu may be necessary.) Second possibility, less funny: the protocol is indeed completely proprietary and unknown to Wireshark. At least, Wireshark will make it easier to examine the binary data.
This may not be in the right location, so tell me and I'll move it.
I am a recent EE grad and I was hired to build a system that exists on a SoC with a simple 32-bit processor. The system basically monitors several external devices and performs some DSP on it, and then is supposed to send the results using a WiFi device (in my case I have the ESP8266 using UDP) to an email server for logging/notification.
I have been trying to find a library that I can use, but my uC can only program in C and I have it set up for UDP, and everything is in C++ using some other protocol, or something else completely.
I am great at DSP, decent at SoC's and uC's, but when it come to this email server communication thing I am at a loss.
I have successfully configured everything for the sensors, the datapath, the DSP, and connected the system to my WiFi via UDP, but I have yet to figure out how to send data to any servers.
Could someone help me understand how I should go about this?
I have looked into some simple SMTP commands such as HELO, MAIL, RCPT, DATA, etc. but I cannot understand how I actually should implement them in my code.
When I send out the WiFi data via UDP what type of data do I send and how do I format it? Do I need to send any other kind of flags? How should I expect the response? I also know the data has to be transformed into base 64 which is confusing me further.
I am also not super familiar with UDP to begin with, I have been using libraries that are part of the SoC's default library to connect to my WiFi.
I know these may either seem like obvious or stupid questions but it is were I no longer have any knowledge, and everything I find online doesn't make sense, or doesn't attempt to explain it, just gives a pre-made solution
I have found the RFC2821 but it doesn't get any clearer.
I know that's a lot but any help at all would be a lifesaver!
Since you are asking this question, I'm assuming that you are not booting and running an OS suitable for micro-controllers such as an embedded variant of Linux or such. If you were, you would simply be able to take advantage of possibly built in applications or other existing code.
But you don't mention having written an Ethernet stack, so are you using some other library or operating environment which might have some of the functionality needed for an implementation of SMTP?
If you don't and really do need to write your own SMTP client to run directly on the processor you are using, then you should be able to find plenty of examples of source code for this. A quick google search of How To Write an SMTP client showed a few articles with some example code. One article seems to be an exact hit, but you need to look at it further.
However, I would highly suggest just sitting down with a telnet client and connect to an SMTP server you are allowed to use and try the commands you need to just send a message. If you only need to send text, you don't need to get involved in MIME encoding or anything like that.
I'm trying to get 9bit serial working for communication with a device that requires the 9th bit set high in order to receive (yea, I know...).
I'm using a pretty standard USB-RS232 dongle with an FTDI chip in it and it appears to be using the FTDI drivers on the system.
I've been using this guide for MARK/SPACE parity which my research suggests is the only way to go (?) and basing my code off of this which I've been lead to believe is terrible but, hey, that's never stopped me before.
I'm pretty sure at this point that the Linux FTDI drivers completely ignore CMSPAR but if anyone knows otherwise, your input would be greatly appreciated. I do know for a fact that the FTDI dongle I have can, in a limited capacity, support 9bit serial as I have the dongle working fine on a windows machine.
Assuming nobody has a magical answer to all of this, the main question I'm asking becomes, how difficult it would be to "fix" the FTDI driver, if necessary, to work? Additionally, where would be a good place to start for someone with limited experience with linux device drivers? Assuming all goes well, it seems I'm not the only person with this problem so it would be great to contribute something, however small, to the community.
If the ninth bit should always be high, just use 8 data bits and one more stop bit than you would normally be using.
To gain more control, use the D2XX Direct Drivers that provide a relatively simple C API.
TL;DR available at the bottom
I've been trying to figure out a way to get two laptops (both running Ubuntu) to be able to pass basic messages back and forth without the need for them to be connected via a wireless network,either by an AP or ad-hoc. I want to reiterate here that ad-hoc networking is not what I'm looking for, I've seen many similar questions here with that as the answer.
I guess what I'm asking is: how do I achieve this? All I really need is for one computer to be able to send a packet, and then for another to pick it up via a packet sniffer of some kind.
Currently: I have both laptops in monitor mode (via a mon0 interface created from aircrack-ng's airmon-ng)so that they can sniff nearby traffic (with Wireshark, tcpdump,tcpcump.org's sample libpcap code, and opening a raw socket and just printing out all the packets. I tried each just because I thought one could be doing something differently/leaving something out). I also have a very basic program that consists of opening a raw socket to send crafted ethernet frames out to the air, but I can't get my two machines to see the other's packets. The sniffer running on each machine can only see the packets going out of that machine (in addition to nearby beacons/control traffic from wifi in the area).
Some things to note that might be important are:
-the packets I'm sending out appear in Wireshark (only on the sending machine) as malformed 802.11 packets (probably because I'm just filling them with junk data for now). I was under the impression that my other laptop would also see them as malformed packets, but it gets nothing
-the sockets I'm using are from a call to socket(PF_PACKET,SOCK_RAW,ETH_P_ALL). Raw sockets are something I just recently was aware of, so I could be misunderstanding how they work, but my impression is that I can craft a layer 2 packet by hand and ship out straight out to the wire/air.
If you're curious as to why I want to do something like this, it's part curiosity, part research for a project I'm working on. I want to streamline / automate the process of setting up an ad-hoc network, and what I'm trying to do here is for the laptops to do a small exchange to figure out the specifics of the adhoc network they are about to create and then make/join that network automatically, instead of either one person explicitly setting up the network OR having both people pre-decide the name, etc of the network and have both computers constantly trying to connect to that specific one.
I'm more interested if I'm going about this process in the right way rather than if my code works or not, if someone thinks me posting my (very basic, taken from another post on Stack Overflow) raw socket code will help, I can.
Edit: I am more than happy to post a complete set of code with instructions if I can get this working. I couldn't find much helpful info on this topic on the internet, and I'd love to put it up for future people trying to do the same thing.
TL;DR I want to send out a packet from one laptop and pick it up on another via a packent sniffer of some sort. No wifi network or ad-hoc network involved. Something akin to spoofing an AP's beacon frame (or similar) for the purpose of sending small amounts of data.
Edit 2:After some thought, perhaps what I'm looking for is some kind of raw 802.11 use? Having direct control of the wifi radio? Is such a thing possible?
I found out I was able to send packets out through my monitor mode interface as long as I had correct 802.11 with radiotap headers. I think the problem I was originally experiencing (not being able to sniff the packets) was because they were malformed and thus not actually getting sent out.
I was able to accomplish this by adapting the example code found here, courtesy of someone named Evan Jones, except I did not need to use an Atheros based card or Madwifi drivers, everything worked fine with the mon0 interface created with aircrack-ng.
I am certain that Apple Mac do this. Apple call it 'bonjour'. There may well be a proper IETF spec for it. This is an Article on Bonjour this is Wikipedia on an open component of bonjour which might help get you moving.
I am currently working on a wireless solution for my Arduino and computer. I am trying to connect a transmitter to my computer and a receiver to my Arduino. I have seen a lot of examples with Arduino to Arduino communication but none for computer to Arduino. What would I need to interface the transmitter with my computer, PIC?
Any insight or any links it would be greatly appreciated.
The jeenode is a good low-cost solution. It really depends on your needs, though.
Sparkfun has a Wireless Buyers guide. It's a couple of years old though. There's also this blog post, which seems to be a pretty comprehensive survey of the available options. It certainly listed every option I've ever heard of and several I'd never heard of before.
This Freakduino board looks interesting. It's an Arduino clone with a built in IEEE 802.15.4 radio (the same radio in the Xbee's). It's also priced very nicely. I wish I'd known about it before I ordered my Arduino Uno earlier this week!
You can use XBee from SparkFun.com. I think they sell a kit for $70 or so. I think they also have wifi solutions too.
Or you could easily connect the two using a Bluetooth module.
Sparkfun has a really good selection and tutorials on how to achieve what you want.
Worth a look in my opinion.
http://www.sparkfun.com/categories/115
There is another interesting low power RF protocol called Ant+. You can find more information at http://thisisant.com.