BluetoothSerial ionic2 - can't connect to device - bluetooth

i'm trying to use Bluez (python) on a raspberry pi to receive data with bluetooth from a ionic2 app. I'm using the built in Bluetooth from "native ionic" which is the bluetoothSerial framework from Cordova
I can't receive any data on the rasp. I'm using list() to check if the device is connected to the rasp (it return true).
I'm using write to send a "hello world" message.
The Ionic2 script:
BluetoothSerial.connect("B8:27:EB:F7:3B:B5");
BluetoothSerial.write("hello world").then(this.success, this.failure);
After the write, my callback succes is called which means that the data was correctly sent.
I was wondering on which bluetooth port the ionic2 app send the data. Bluez need a specific port to listen to.

Related

ESP32 smart wifi configuration via esp32 wifi AP(Access Point)

I want to make a React-Native application to provide wifi-credentials to esp32 module via esp32 wifi access point.
I see there are some library of npm that we use to provisioning wifi config to esp32.
For ex.
react-native-esp32-idf
react-native-esp-idf-ble-provisioning-rn
But i'm confuse how to use them and may be these are provide credentials via BLE or Bluetooth but I want to provide SSID and PASS via wifi.
Means, I have a esp32 module and at begining i use it as a wifi-access-point then my application would be connected to esp32 by wifi automatiically then by communition through wifi-hotspot b/w app and device i provide cred. to device-esp32.
Thats it!
So how i make this application in react-native?
A simple approach would be like the following:
ESP32 is powered up
ESP32 opens a Wi-Fi access point
ESP32 starts an HTTP server acting as REST API
Any HTTP/REST client (including the react native app) can set the
Wi-Fi password and SSID using via the REST API
Once the Wi-Fi password and SSID are set, ESP32 restarts as a Wi-Fi
station and tries to connect to the configured Wi-Fi password and
SSID.
This way on your react native app you'll only need to use a simple HTTP/REST client

Connecting to Web Bluetooth

I'm trying to connect a bluetooth device (ESP32, peripheral) with Web Bluetooth (central). I send an addvertising packet and I can see the device on the web page, but I fail to connect to it. My code for the ESP32 looks like this: (MicroPython)
ble.gap_advertise(interval_us=100, adv_data=bytearray(b'\x02\x01\x06\x06\x08\x45\x53\x50\x33\x32\x11\x07\x26\x6c\x34\x7f\xb2\x38\x61\x82\xbe\x4d\x1d\x64\xf1\xf7\x93\x16\x02\x19\x80'),resp_data=None, connectable=True)
In Web Bluetooth (JavaScript) I just request a device and try to connect to the gatt.
Can anyone help me out?
Thanks in advance!
The JavaScript does work with another bluetooth peripheral. (RN4678)
And in JavaScript I can find the peripheral (ESP32) after filtering, but I can't connect to it.
JavaScirpt:
server = await device.gatt.connect()
The code stops at that point.
MicroPython:
The GATT is defined using:
ble.gatts.register.services()
I'm trying to use my own service, not a SIG defined one. So I advertise b'(x...') which contains the flags, the service and the device name. And it works with the nRF Connect App. I can send and recive data. But it doesn't work with the bluetooth enabled web browser.
Thanks for your help!

Using Raspberry Pi3 as Lora gateway

I'm trying to use Pi3 as my LoRa gateway with sx1276 LoRa modules.
The module with sx1276 chip and single channel connect via SPI interface.
Test with Arduino are work great. Both send and receive are success.
But there's some problem when I was trying to connect Raspberry Pi3.
The source code [node-sx127x][1] is from Gitub, it is a install by npm and node.js.
So far seems good and the sender.js run great on my Pi3, the data will be received by Arduino code.
But the receive.js could not receive any data from any nodes!
The register process seems good, because the Pi will print "open success" after it catch the SPI and Lora module!
I've been tested the frequency and bandwith from sx127x.js, it is available when I change the value.
And both of sender.js and receive.js are using the default value from sx127x.js.
So I'm not sure what's the problem.
The modules I used are sx1276. I've tried two modules but the result are the same.
enter image description here
enter image description here
I would recommend you to take a second RaspberryPi to ensure your problem isn't in the Arduino. If the Pi-Pi connection works you have to look into the arduino script. Otherwise your pi is not working.
You could also try Arduino-Arduino connection.
could you post your Arduino send script

How to receive sms messages on raspberry pi

I recently set up a Twilio account and got a registered Twilio phone number. Is there a way that I can get those messages on my raspberry pi? My intent is to display those messages on a LED screen.
You'd have to either expose the RasPi to the public internet (so Twilio's SMS callback could reach it), or use some proxy service in between.
The proxy would capture the inbound callback, then the RasPi could either poll, or use some better method, to check for new messages (meaning, the RasPi does not have to be on the public internet).
Temboo also has a set of tools that make it easier to build IoT applications that interact with APIs. I believe they can act like the proxy I describe.

PC To NXT Brick via Bluetooth

We have a fully-working java programme which can connect to another computer and can send messages from this(both sides run java and we used ObexPutClient and ObexServer), however when trying to connect to the NXT Brick and send a message via bluetooth we are able to pair with the brick and we can send a message but we have no idea if the NXT receives it.
When we tried to use Java ObexPutClient on computer(we provide the ServerURL of NXT to java programme) to send the message to NXT Brick running the RobotC, it does't work. On java side, the error is given:
"Failed to connect; [10064] A socket operation failed because the destination host was down."
Is the error we receive on Java.
Using robotc the brick is waiting for a message to be sent and it is awaiting 3 integers to help the robot move.
How have people sucessfully done this, we have ensured the port number is the same.
The NXT does not provide the OBEX Bluetooth service. It uses the Serial Port Profile (SPP - also sometimes called RFCOMM). When you pair your NXT with your host computer, it will create a serial port (e.g. COM4) on your host computer. In your Java program, you need to open this serial port and send data that way.
Also, leJOS has a PC Library (Java) that includes communication and remote control features. You could probably use this so you don't have to write your own.

Resources