Need help using Arduino R3 as serial-to-usb converter (to program something) - driver

I have researched (and learnt quite a bit), but I have little experience in programming and only really understand basic sketches so far. I would like to use the Arduino R3 (more specifically, the usb to serial converter chip) to program a full-size hobby radio.
I have connected my radio to the Arduino appropriately (5V, Rx, Tx, Gnd) and put the Arduino into Tristate mode (apparently you have to do this..), but I seem to be lacking appropriate drivers. I basically want my Arduino R3 to function exactly like this: CP2102 . Please note that I am not being super cheap. To get something like that where I live would take at the very least a month. Some people also say that I should remove the Atmega chip. The ultimate goal is that I have a device, with drivers, on a com port and not just an "unknown device".
So, my questions are: leave the Atmega on, or remove it? and which drivers do I need?
Thanks!
EDIT: I found almost exactly what I need just after I posted. For some reason I couldn't get it to work, but maybe you could help me understand? Here's the link LINK If anyone is keen to help me out!
Just to make it clear: it has been done before, but I get the feeling people leave out things which they think are obvious, but to the not-yet-professional tinkerer like me aren't :/
Thanks so much!

It seems like the links you reference are for older Arduinos with an FTDI chip. The Arduino Uno doesn't use that. Here's a link for using the Uno
So! All of the older Arduinos (NG, Diecimila and Duemilanove) have
used an FTDI chip (the FT232RL) to convert the TTL serial from the
Arduino chip (Atmel ATmega). This allows for printable debugging,
connecting to software like PureData/Max, Processing, Python, etc.
etc. It also allows updating the firmware via the serial bootloader.
The good news about the FT232RL has royalty-free drivers and pretty
much just works. The bad news is that it can -only- act as a
USB/Serial port. It can't act like a keyboard, mouse, disk drive, MIDI
device, etc.
and
The Arduino Uno has a number of facilities for communicating with a
computer, another Arduino, or other microcontrollers. The ATmega328
provides UART TTL (5V) serial communication, which is available on
digital pins 0 (RX) and 1 (TX). An ATmega16U2 on the board channels
this serial communication over USB and appears as a virtual com port
to software on the computer. The '16U2 firmware uses the standard USB
COM drivers, and no external driver is needed. However, on Windows, a
.inf file is required. The Arduino software includes a serial monitor
which allows simple textual data to be sent to and from the Arduino
board. The RX and TX LEDs on the board will flash when data is being
transmitted via the USB-to-serial chip and USB connection to the
computer (but not for serial communication on pins 0 and 1).

Basically the LINK you provided, shows the user HACKING the Arduino. Using the USB/Serial(TTL) converter(what ever chip that is on your Arduino) to link to the Radio's Mini Din connector, in place of connecting to the Arduino's CPU.
As stated in other answer the Arduino uses a CHIP (of some flavor) to bridge the USB(Virtual Serial Port) to the Serial Port of the ATmega328 micro. These pins are available on the Shields connector 0(RX) and 1(TX). Hence you see the picture wiring those pins to the Radio's DIN connector.
Where I would expect in addition the RESET of the Arduino's CPU would be held to GND, this would force the pins into Hi. Simply with an extra wire jump the RESET pin to a GND.

It's working! Somewhere along the line the drivers for my arduino seem to have been deleted, so I reinstalled them, did what you said, and learnt something.
So to clarify for others: pretty much plug and play (as the link I posted suggests), but make sure to install the arduino drivers properly.
Thanks a lot for the help!

Related

How to capture and send packets via Macbook

I want to capture and send some packets to the access point for testing purposes. I have the packet captures made via wireshark but I do not know how to proceed to be able to send these packets from my macbook.
I tried things like scapy, colasoft etc, but they do not seem to work as they require an external wifi adapter to be able to relay these packets outwards.
Two main questions:
Is it possible to send custom packets from macbook to a required access point. (Without using external network adapter).
If yes, what are some tooling/Scripting options that I can look at ? Any recommendations?
I am networking novice so please pardon me if the question is trivial. Thank you!
Your builtin Wifi adapter likely does not support Wifi injection.
You can check this by googling the Wifi chip that is within your computer (there are various methods to get that info depending on your OS) whether it supports Wifi injection or not.
So yeah, you'll likely need an external card (check the specs before buying it)

How to connect TX and RX on the ESP8266 to USB pins D- and D+ on the NXP LPC1769?

I have a board (with NXP LPC1769) hosting an application and connected to the PC via USB cable. I use an application running on my PC and communication is pretty straightforward (some ASCII commands are exchanging) and working as it should be.
So, what I would like to achieve is to connect my favorite WIFI module ESP8266 using its TX/RX pins to the USB connector (D- and D+) of the NXP LPC1769 instead of my PC.
You may ask why you don't use any UART pins of the LPC1769. And my answer, I would love to. But it requires pretty much code modification which is not pleasant at this stage for me.
Pins P0.29 and P0.30 used from LPC1769 connected to USB connector.
Here is the existing schematic;
I would like to ask if this is even possible, and if possible, what are the options?
(I am inexperienced with NXP MCUs, still a work in progress, please bear with me).
Thank you.
NO my friend, it is simply not possible to connect USB serial to Rx/Tx pins of the ESP8266. First there is the hardware limitation, only asynchronous serial communication is possible with the ESP8266. That device has no USB host in it that can be programmed so there no way to do what you ask simply with that circuit. Nevertheless i would suggest implementing a simply board with a FTDI device of your choice (FT232R for example) and do the conversion from USB to asynchronous serial communication (Rx/Tx) directly.

What exactly determines what’s in the radiotap header when capturing on WLAN?

I’m doing a study project on wifi signal quality. What I want to do is use Raspberry Pi’s to monitor as many metrics as possible on packet level data. I want to do this by putting wifi adapters on monitor mode (using airmon-ng) and than capture the data about the packets using a wireless network protocol analyzer, like tshark.
What I understand from the wireless networks is that you mainly have three parts: a frame part that has the same information independent of what you’re capturing on, which contains things as frame number, frame length and arrival time. (Want to upload images but don't have 10 reputation yet...).
Then the IEEE 802.11 data which contains the necessary stuff for the network to work. When capturing on WLAN this contains the MAC addresses.
And than we have the radiotap header, which contains all kind of information (signal strength db and dbm, noise level, signal quality, TX value, and much more). This one is a bit different, since this information is actually filled or injected by the wifi adapter you use to capture the data with.
In the present flags you can find which values are actually being injected by the wifi adapter. Now my problem is that for my research I really need as much values as possible. I’ve been working for hours but I didn’t succeed in finding a way to capture with anything more than dmb signal strength (if even available). So this is what I tried so far:
The adapters I used so far are the Edimax EW7811UN, the AirPcap Classic, the AirPcap Tx and two similar alfa adapters with Atheros AR9271 chipset. The AR9271 adapters worked out of the box on raspbian (debian for raspberry pi) on the ath9k_htc driver. Putting them on monitor mode and capturing works fine, but only dbm singal strength is given (as in the screenshots above) in the capture. The Edimax was working out of the box on the 8192cu driver, however it clearly doesn’t support monitor mode. I could put it into monitor mode when booting it on the zd1211rw driver but that didn’t even give the dbm signal strength. Strange thing however, is that a friend tried the exact same Edimax adapter and he could capture, and the only difference we could find is that the lsmod says rtl8192cu and not 8192cu. Strangely, forums are saying that 8192cu is the newer version, however this friend had the newest arch linux kernel installed (newer than the raspbian). So I installed Arch Linux on the pi, but still wasn’t able to put the edimax on 8192cu driver in monitor mode. Then I found a package in the aur repos: dkms-8192cu which was supposed to have a patched version. However, after installing it still didn’t work. Also downloading the driver from the realtek website didn’t work. There is some stuff on patching on the aircrack-ng website, but it actually is mentioning injection of frames and doesn’t really look to be what I exactly need.
Than I bought the Airpcap Classic and the Airpcap Tx to see what they could do. First of all, they have zero linux support so that already is a big drawback since l need to use it from the Pi’s. However even in windows the airpcap’s only capture db and dbm noise and signal quality. It does receive some data at dbm noise level, but it’s worthless since it is always at -100 level. I can boot the Airpcap classic and tx have zd1211B chipset so I can boot them on zd1211rw driver but this also gives no dbm signal value or anything else.
So my question is, what exactly determines what’s in the radiotap header? I guess it would be all in the driver, but I need to be exactly sure before I write off every ath9_htc driver based adapter. I’m about to purchase another adapter which runs on carl9170 driver, however I can’t find no guarantee anywhere that it will give me those values. What I did find in the literature is that the madwifi driver gives (or was giving) noise levels, however it is acquired by Atheros so the project stopped and all websites are suggestion just to use ath9k or ath5k drivers. I tried to install it but I failed because it seems to be really outdate software since the project stopped.
It would be of really big help if someone can explain me what exactly determines what’s inside the radiotap headers, and also if someone could share any experience on when they did capture more than only dbm signal strength values from linux.

How to troubleshoot CAN bus communication

I am trying to connect ICP CON i-7565 (USB<->CAN interface) to a custom made device (supporting CAN2.0B, proved to work with PCL-841 card) Although I think I have configured BAUD and acceptance code/mask correctly I can see CAN no messages coming from the device (ICP provides a tool that should allow me to send and receive CAN messages).
I am new to CAN bus so I appreciate any help regarding how to identify the problem.
I-7565 might be wrong interface for me, I might have misconfigured it, or it is simply broken. Or I am just doing something wrong out of my ignorance. I don't think anyone can help me with my specific problem, so I am rather asking for general information on how are problems with CAN bus identified and analyzed. In TCP/IP for example, you would call ping, you'd recheck your ip and gateway settings etc. What do you do for CAN communication?
Additional info:
OS: Win7 64bit
connector: DB-9 with standard wiring (2,3,7)
Finally I tried to work with different USB<->CAN interface from different manufacturer and it worked like a charm. My old interface was either broken or incompatible for reasons unknown. While working on this problem I learned couple of things about CAN bus and so now I share what I think was the right answer to my original question: How to troubleshoot CAN bus communication?
read manual to your USB-CAN interface
install driver of your interface device and make sure it is working (check device manager, depending on the type of your device you will see new COM port added or new USB controller )
your device should be shipped with it's own test/analysis software (they might call it utility or similar), run it and check if it can connect to your device
CAN communication uses three wires that are referred to as High, Low and Ground and is usually connected with DB-9 connectors where High is linked to pin n. 7, Low to pin n. 2 and Ground to pin n. 3 or 5 - make sure this is connected correctly on both your USB interface and CAN device you want to communicate with
set properties of your connection, these are most of all: CAN type (2.0A or 2.0B) BAUD rate, Acceptance Code and Acceptance Mask
if you've done all of this and still you can see no CAN messages arriving in your utility program, check with a different USB-CAN interface or find some other way to test if your device is actually emitting CAN messages and your USB interface is in fact able to receive them. (this was actually my case)

iOS virtual button to Arduino

What would be the best way of sending a signal from an iPad to an Arduino?
I am trying to use XBee, with iPad and Arduino to send a wireless signal.
I want to make a big red virtual button on an iPad that, when pressed, turns on an LED on the Arduino.
I am a total newbie when it comes to iOS, but OK with Arduino and XBee.
So I'm not sure if I understood correctly, but in my meaning there is only one simple way to solve the problem:
Connect an XBee to a Computer and another to the Arduino. On the computer you launch a webserver, which will be accesible from the iPad over Safari. This server handles the clickes and writes to the XBee Com Port, for communication.
Here are some examples, people already made:
http://www.projectallusion.com/1/post/2009/11/iphone-controlled-solar-powered-arduino-tank.html
http://www.sparkfun.com/tutorials/152 (not with xbee, but you can implement that by yourself)
I know it's been a while but I just came across to this question and yesterday I was doing the exact same thing so I'll share the method I used and the source of it.
In order to set a LED on or off in an Arduino board from the iPad you really don't need anything more than a browser. This is of course if you have a way to connect that Arduino to the local network.
Today you have at least two options. The WiFi and the Ethernet shields. Once you have your Arduino board inside the network you can send the instructions (HIGH or LOW) to the board form the browser.
These are my two boards connected waiting to be plugged to the local network:
Of course, you'll have to code the board to process those instructions. There are many examples on how to configure network settings and state instructions:
If you have a bit of time and want to do something more elaborated you could create a simple app to graphically control the state of those LED(s).
Inside you'll basically do the same thing, create the URL command and send it to the Arduino IP but it'd look much nicer. If you integrate later more controls the sky in the limit.
My experiment is a combination of what I learned from this nice tutorial and some tips I've read here and there.
I hope it becomes also useful to someone else.
Cheers,
Since you need to use a network connection from the iPad, a possibly simpler way to do this would be to use a WiFi module on the Arduino to poll a web script, and have the iPad write a state (button press) to that web script.
There's a handy WiFi module called the RN-XV that's designed like an XBee. I wrote up two tutorials on it:
http://log.liminastudio.com/programming/getting-started-with-the-rn-xv-wifi-module-node-js
http://log.liminastudio.com/itp/physical-computing/using-the-rn-xv-wifi-module-as-a-remote-switch

Resources