How USB to Bluetooth DTR/RTS work? - bluetooth

A number of bluetooth Arduino shields (Bluefruit EZ-link, SparkFun Bluetooth Silver) support DTR/RTS and have special out pin to wire. How do they work? Does it require special drivers (linux f.e.)? Can any bluetooth receiver be used or modified to provide DTR/RTS? Since setting DTR/RTS is vendor-specific does it depend on transmitter side or receiver (bluetooth shield) only?
The only idea is that special USB drivers needed that send special AT commands to make BT receiver know actual DTR/RTS value.

The documentation of Bluetooth SPP (https://developer.bluetooth.org/TechnologyOverview/Documents/SPP_SPEC.pdf) states in section 4.1 RS232 Control Signals that "all devices are required to send information on all changes in RS232 control signals".
And since Bluefruit EZ-link is not using any special drivers on the side of the computer, it must be that the standard BT virtual serial port drivers that manage the ports created for the BT connection to Arduino handle the control signals properly and send them over to the BT shield connected to Arduino. Hence no work should be needed on the side of the computer, and it only depends on the receiver: whether it has the control signals accessible on any of the output pins and operates them as it should, or not (as usually is the case, unfortunately).

Related

How to use APC220 Radio Communication Module in raspberry pi

I am developing a project using Arduino to send a message to Raspberry Pi using an APC220 Radio Communication Module.
The Raspberry Pi can't receive serial message by using USB connect to APC220. I want to know how to use APC220 in Raspberry Pi?
The APC220 has a TTL UART interface which you can connect directly to the RPi TTL UART pins on the GPIO header - you do not need the USB-Serial converter (though that should work too if it is a standard CDC/ACM device - though this suggests that there may be issues).
A note of caution however, the RPi GPIO pins use 3.3Volt logic, the APC220 datasheet is not clear on the TTL level used, but the specified supply range is 3.3 to 5.5 volts so it seems likely that it is 3.3V - best measure it to be certain. You can probably use the RPi GPIO headers's 3.3V supply pin to power the ACM220, then you will be sure to be safe. If the ACM220 level is too high, the quick-and-dirty solution is to use current limiting resistors in-line to protect the RPi (10KOhm should be enough, but don't hold me responsible; you should know what you are doing before proceeding).
The UART device on the Pi is /dev/ttyAMA0.
See here for details of serial I/O on the Pi.
22 Feb 2012 Update
The discussion here suggests that to make the TTL<->USB adapter work on Raspberry Pi, you need to disconnect the EN signal - the discussion links back to the manufacturer documentation, which gives that advice in the troubleshooting section. Since that makes the device appear as a USB serial, and you won't have to reconfigure the on-chip serial or build a connector that may be simpler.

Can I connect 2 RFID card readers to one arduino?

I am looking for connecting to ADAFRUIT RFID PN532 readers to one arduino,
I think its possible since I2C was for that, but how can i modify the code (Which is already in RFID ADAFRUIT LIBRARY) two access through the both readers at one instance ?
No, you can't connect two Adafruit PN532 shields on the same I2C bus. The problem is that you can't change the peripheral address of the PN532. Thus, both PN532 NFC chips would respond to the same address and you can't control which of the two shields you communicate with.
However, you may be able to separate the two boards
by using an I2C multiplexer that switches between the two boards, or
by using the SPI option of the PN532 shields. In SPI mode you have an additional chip-select PIN that you could wire to separate PINs of the Adruino. You could then address a specific PN532 shield using those chip-select lines. However, you would need to port the PN532 library to SPI communication.

How does Bluefruit EZ-link perform DTR/RTS over Bluetooth for programming?

Bluefruit EZ-link is described as programmer. It means it supports RTS/DTR:
The EZ-Link has another impressive feature: the DTR/RTS/DSR flow
control pins are automatically synced to the computer serial port.
What this means is that if the computer sets the hardware flow control
DTR or RTS pins high or low the pins on the bluetooth module will
follow.
So Arduino IDE performs reset to initiate flashing (as Arduino's Bootloader wait for few seconds after reset for upload commands from Arduino IDE). For USB reset works by switching DTR to 1 and 0 and special schematics on Arduino board monitors it and performs reset. After reset is done Arduino IDE runs avrdude and start flashing.
The question is "How does it works over Bluetooth module by Adafruit?" There is no RTS/DTR line for Bluetooth..
PS. I believe virtual COM-port drivers for this Bluetooth device should send special AT+ commands and Bluetooth device should handle them and perform setting 1 or 0 to special pin wired with MCUs reset. But this requires Bluefruit bluetooth driver to be used. But i can't see it requires special BT drivers at computer.
RFCOMM do support flow control.
RFCOMM is based on GSM TS 07.10. Bluefruit extract info on RFCOMM and map it to flow control lines.

Communicating with USB bluetooth dongle from FTDI vinculum 2 USB host controller

I have been asked to figure out how to achieve bluetooth communication through an off-the-shelf dongle (in this case a dongle utilizing the Broadcom BCM2045 chip) using the FTDI Vinculum 2 (VNC2) USB controller. I have custom firmware written for the VNC2 to communicate with a generic USB device with the VNC2 acting as the host, and I can successfully read the VID and PID from the dongle as well as the USB device class, subclass, and protocol. I can also send data to the dongle using the bulk data endpoint and I believe the device is receiving though I have no way to tell at the moment.
So I believe I can communicate with the dongle, the problem is I have no idea WHAT to communicate to it in order to set it up in discoverable mode or to pair it with another discoverable device, nor how to actually transmit data through the wireless link once it is paired. I don't even know if there exists a standard communication protocol for this type of thing or if every device will be different. I have a vague understanding of the bluetooth protocol stack and it is my understanding that I won't be required to fully understand that as it should be implemented in the dongle on one end and in the android smartphone that we hope to connect to on the other end. Like I said, I can currently send data to the bulk endpoint, is it true that this endpoint is only for data transfer over the wireless link and I will need to connect to a different endpoint in order to send setup/configuration messages to the dongle?
In short, I need to know what data to send over the USB bus to control any generic bluetooth dongle if possible or at least one specific bluetooth dongle. I have a USB port sniffer but the complexity of the output while using the dongle to communicate is staggering and I doubt I'll ever figure it out.
Thank you in advance.
Bluetooth dongles communicate with host software stack using HCI (host control interface), which is defined in the Bluetooth spec. For reference, you can look at source code for the open source BlueZ stack (standard linux stack). You could run BlueZ on linux talking to your USB dongle, and use hcidump to capture actual packets going across HCI. You can also check out hcitool and hciconfig for performing specific actions.

How to send keystrokes from one computer to another by USB?

Is there a way to use one computer to send keystrokes to another by usb ?
What i'm looking to do is to capture the usb signal used by a keyboard (with USBTrace for example) and use it with PC-1 to send it to PC-2.
So that PC-2 reconize it as a regular keyboard input.
Some leads to do this would be very appreciated.
What you essentially need is a USB port on PC-1 that will act as a USB device for PC-2.
That is not possible for the vast majority of PC systems because USB is an asymmetric bus, with a host/device (or master/slave, if you wish) architecture. USB controllers (and their ports) on most PCs can only work in host mode and cannot simulate a device.
That is the reason that you cannot network computers through USB without a special cable with specialised electronics.
The only exception is if you somehow have a PC that supports the USB On-The-Go standard that allows for a USB port to act in both host and device mode. USB-OTG devices do exist, but they are usually embedded devices (smartphones etc). I don't know if there is a way to add a USB-OTG port to a commodity PC.
EDIT:
If you do not need a keyboard before the OS on PC-2 boots, you might be able to use a pair of USB Bluetooth dongles - one on each PC. You'd have to use specialised software on PC-1, but it is definitely possible - I've already seen a possible implementation on Linux, and I am reasonably certain that there must be one for Windows. You will also need Bluetooth HID drivers on PC-2, if they are not already installed.
On a different note, have you considered a purely software/network solution such as TightVNC?
There is a solution:
https://github.com/Flowm/etherkey
This uses a network connection from your computer to the raspi which is connected to a teensy (usb developer board) to send the key strokes.
This solution is not an out-of-the-box product. The required skill is similar to programming some other devices like arduino. But it's a complete and working setup.
The cheapest options are commercial microcontrollers (eg arduino platform, pic, etc) or ready built usb keyboard controllers (eg i-pac, arcade controllers,etc)
SEARCH THIS PROGRAM:
TWedge: Keyboard Wedge Software (RS232, Serial, TCP, Bluetooth)
then, MAKE YOUR OWN CONNECTION CABLE WITH:
(usb <-> rs232) + (NULL MODEM) + (rs232 <-> usb)
Connect 2 computer, write your own program to send signal to your (usb <-> rs232) unit, then you can control another computer under the help of TWedge.
The above mentionned https://github.com/Flowm/etherkey is one way. The keyboard is emulated from an rPi, but the principle can be used from PC to PC (or Mac to Whatever). The core answer to your question is to use an OTG-capable chip, and then you control this chip via a USB-serial adapter.
https://euer.krebsco.de/a-software-kvm-switch.html
uses a very similar method, using an Arduino instead of the Teensy.
The generic answer is: you need an OTG capable, or slave capable device: Arduino, Teensy, Pi 0 (either from Rapberry or Orange brands, both work; only the ZERO models are OTG capable), or, an rPi-A with heavy customisation (since it does not include USB hub, it can theoretically be converted into a slave; never found any public tutorial to do it), or any smartphone (Samsung, Nokia, HTC, Oukitel ... most smartphones are OTG capable). If you go for a Pi or a phone, then, you want to dig around USB Gadget. Cheaper solutions (Arduino/Teensy) need custom firmware.

Resources