I've been trying to figure out how to turn my Raspberry Pi into a USB to Bluetooth serial adapter. I want to be able to send data over Bluetooth to the Pi which has a USB thermal printer registered at /dev/usb/lp0.
Using only standard command line apps such as hciconfig, hcitool, rfcomm, and sdptool I have been able to see the Pi as visible, and pair to it from an Android tablet using a Bluetooth SPP app on the Store. However, the tablet disconnects immediately, and no data is sent. rfcomm listen /dev/rfcomm0 1 also waits for a connection forever.
I think I'm able to achieve what I need without custom code, using solely standard command line apps, but I'm not entirely sure. socat will likely be of use to finally connect the sockets.
Figures that I'd get it right after posting. To anyone else looking to do something similar:
Pair with bluez-simple-agent
Create your serial port channel with sdptool add --channel=x sp
Listen for a connection on that channel with sudo rfcomm listen /dev/rfcomm0 x
Cross the streams with socat /dev/rfcomm0 /dev/usb/lp0
Beautiful. It's all so simple now.
Related
My GPS module doesn't automatically turn on its GPS to receive data. The module uses AT commands to turn on GPS and the the GPS shuts down when you remove it from its power source.
The problem is I can turn on the GPS with PUTTY serial monitor when connected directly to my laptop for testing, but I don't know how to turn it on when connected to my raspberry pi because I don't know how to send the AT command through the raspberry pi to power it up.
Is there a way i can send AT commands to a connected device on my raspberry
I have tried the cu method but it doesn't seem to work as I receive no response when I input the AT code
So if I understand it correctly, you can connect the GPS module to your laptop directly and send the AT commands to it but, you are unable to do the same with your RPi.
Think of it like this, how is the computer being able to send the AT commands? Through a UART right? So that means you need a UART like connection between the 2 devices to be able to send AT commands.
Now, lets just replace the computer with the RPi, again you would need a UART connection between the GPS module and the RPi module, lets say a simple RS232 connectivity. Once you have this connection established, you will have to program your RPi to send the appropriate commands to the GPS modem via this connection. So probably what you need to google now is "RS232 communication using RPi". And of course you will need the Tx and Rx connections to be proper between the two devices.
we are doing a project for receiving data from a device using a RS232 to ethernet converter (gridconnect net 232+) onto to a Atmel board. When we connect the converter to the PC, we are getting the output but not when connected to the microcontroller board. We need to know if there has to be some network confirguration to be done on the converter in order to receive it on the microcontroller.
Thanks !
I haven't worked with that board or device, but with any RS-232 communication channel you should check that all RS-232 parameters are set up correctly on both sides. Databits, stopbits, parity settings, etc. Even one setting being off will completely stop RS-232 communications.
Once that is done, I'd hook up a terminal emulator of your choice to simulate the microcontroller side and make sure that you're getting the right traffic from the Ethernet side. You might get lucky at that point and everything might start working. ;)
I made some experiments with this amazing module. Now I'm trying to level up my project so I connected it to my Raspberry Pi via UART.
I'm able to send AT commands to make simple connections like I do on my Arduino. How can Linux "see" it like a real WLAN0 interface?
I'd like to use the ESP8266 as an access point to surf the web (maybe bridging the ethernet cable interface).
Is it possible?
No, you can't (easily) make the ESP8266 a true WiFi device for Linux. Although projects like this one here have figured out how to put the device into an ESP8089 mode to use it as a true WLAN interface, it requires modifying the module itself.
You can, however, use the device's AT API to connect to the internet through a UART and send any arbitrary data, or develop your own firmware to pass data back and forth to a server with the ESP8266 - None of these though would allow a seamless TCP connection like an actual WiFi card would, however.
I want to read text message using Matlab as hyperterminal using AT commands and bluetooth as connection medium since I am new in it could somebody suggest that how can I do it.
I am using nokia c2-03 for sending the message but if you suggest any other phone i can that too
I connected my phone through USB, saw the Port name then connected it through matlab using
s=serial('COM1');
and then opened the port
fopen(s)
now I don't know what to do I mean now how can send at command to control the device.
PS I am sure that my device supports serial communication.
I am building an Arduino based servo driver that I want to control with OSC commands from my iPad over the Internet.
Is it possible to send OSC commands over 3G / UMTS with my iPad or iPhone to control a device? So I will not be limited by the router's range when I send OSC commands to the controller when both devices are part of the same Wi-Fi network.
It seems that the applications I downloaded (TouchOSC, iOSC) can only send OSC data over Wi-Fi, however I'd like to send the commands over the Internet (with port forwarding settings in my router).
I would get one of these. Look ma, no wi-fi :)
OSC typically uses UDP (User Datagram Protocol), even if some newer OSC implementations also allow TCP/IP messaging (also see Difference between TCP and UDP?).
Unfortunately (as far as I know), UDP does not work over 3G, which seems to be your problem. In other words: two mobile devices cannot talk to each other on a cellular network. So it has nothing to do with OSC apps not being able to do this, it's just not available from the cellular network.
However (I think, not tested), I see two workarounds here:
try to use TCP/IP instead of UDP to send your OSC packets
if you need UDP on the Arduino side, you could use a server in-between
Do port forwarding on your router to forward port x to the Arduino, and then use the IP address from whatsmyip.com and use that one in the touchOSC app when inputting the IP address. That may work.