I wanted to make a connection to LEGO Spike prime hub using LEGO wireless protocol through bluetooth.
I tried to run examples from github using c or go but its failed. I couldn't force Linux to receive frames. I tried to use go bluetooth package but still a message that profile is note available. The only way I could connect to Spike was rfcomm but I cant receive LEGO wireless protocol frames this way. Do you have aby suggestions what I should do?
Regards
Jack
Related
I am trying to make a Windows driver for a bluetooth gamepad, I know exactly what data the gamepad sends via bluetooth, but I have no clue where to start with this project, I have searched far and wide for more information about how to recieve data through bluetooth with WDK, but I have yet to a good source of documentation or a good example. Everything has to be coded in C, I have already setup the basic driver and tested it on the device, all i need now is functionality.
So my questions are:
How do you connect to the right bluetooth device
How do you send/recieve bluetooth data using WDK
How do you emulate a HID gamepad device after parsing the bluetooth data
Any links to documentation, examples or possibly books would be much appreciated.
I am using the socket module in python to send commands to my raspberry pi to turn GPIO pins on and of.
I am switching to C, where I will use winsock.h and winsock2.h to create the server on my PC and sys/socket.h to create a client on the raspberry pi.
Is it possible to establish a connection between these two different libraries?
I only want to create a socket, bind, send and recv. No other operations.
I recommend you to check this documentation, there are some examples for a Windows Server / Client connection:
https://learn.microsoft.com/en-us/windows/win32/winsock/getting-started-with-winsock
For Linux you need to do some adaptations as you might know or you have already implemented, I did the same for 2 desktop applications to send data from a Linux PC (client) to a Windows PC (server). As mentioned in the comments it doesn't matter the devices while they are in the same network and follow the TCP/IP protocol.
I was able to do this even connected through a VPN. Unfortunatelly I can not share the code. But I developed this communication based on the documentation from the link above.
I hope it helps. Actually if you want to use Python in the raspberry Pi there is also a python built-in package that you could use: https://docs.python.org/3/library/socket.html
And you can use the code from the link above in Windows. It should be straighforward.
I want to establish Bluetooth network where one server can communicate to two clients (ie piconet) using C programm on linux platform, rfcomm based communication.
Can any one please share your guidance or sample source code if have.
I newbie to the bluetooth technology, have not found any useful info or code from internet source so far. so please.
Thank you
Basu
Linux runs open source BlueZ Bluetooth Stack, which works quite well (unless you need Bluetooth Low Energy). You can check out this tutorial: http://people.csail.mit.edu/albert/bluez-intro/c404.html
PS. Mind the GPL license when using #include like in those examples.
Edit:
As for creating piconet specifically, I'm afraid I don't have any snippets. However, after quick search, I would look into using bluez library to open not one but many RFCOMM sockets. So you can listen to and accept multiple connections.
I am trying to implement Bluetooth using "connect-blue-oem-spa-331" module using UART protocol and using MSP430 as base controller. I'm using Embedded C as a language of programming.
Everything just works fine until I reach to Serial Port Link Command "AT*ADCP". Every time I get response as ERROR. I have tried with both options by keeping ECHO ENABLED and ECHO DISABLED.
p_cmd = "AT*ADCP=XXXXXXXXXXXX,0,0,0\r";
this is my command. 'X' represents the Bluetooth confirm device address which I confirm when I execute DEVICE_INQUIRY command.
The module through which I am executing all these commands is always MASTER and will initiate pairing and communication process. As a safety I have kept it non-discoverable.
How can I implement the Serial Port Profile Link command without getting error when I confirm the bluetooth device using DEVICE_INQUIRY command.
I have been working with blue tooth for last 4 months. I had faced above issue in early days. And after running through documentation available for product I solved the issue. I thought to reply this question which I've asked.
I was using Connect Blue OEM-SPA-331i classic Bluetooth module in my project, and was using Serial Port Profile to implement Bluetooth commands.
When I inquire devices I get the list of Bluetooth Devices available and discoverable in the vicinity(mine was CLASS-I Device); and lists them as (48 bit MAC Address,Class of Device) i.e. ( 001234ab987f,786545) of the discovered Bluetooth Module.
When I'm trying to establish Serial Port Profile Link, it was required that I must write address of peer device to be connected over Serial Port Profile in Serial Port Adapter. The order of the commands should be
Inquire discoverable devices
Write the desired peer device address to Serial Port Adapter, remember it in power cycles.
Establish Profile Link.
This way I resolved my issue of link not getting established.
I am doing some projects with Arduino at the moment, and I was wondering if it is possible to make HTTP requests without the Internet shield.
The idea was to make a program which does HTTP requests and sends the response to the Arduino over the serial port.
I did some search online, but I could not find a way how to send the response to the Arduino board.
Yep, I've done this. I had a remote temperature logger built with an Arduino. Then I used the USB cable to connect the Arduino to a laptop. The laptop had a WiFi connection to my network and could get out to the Internet if it wanted to, but I actually just connected to my desktop.
I didn't do anything special on the Arduino other than writing to/reading from the Serial port. I had a tiny Python program on the laptop acting as a gateway to the network (read from Serial, write to port and vice versa) and another tiny Python program on my desktop to read from port and write to disk.
it is possible also to use pyfirmata in a python web server like flask under linux to control your arduino via web interface.your arduino will commnunicate with your web server via firmata protocol