I want to build an app in react native that receives sensor data from Raspberry Pi 3B, displays it, and stores it in a Firebase backend. I can't find much information online about how I could do this. Do I receive the information from the RPi using Python and then transmit it to the app, or do I use JavaScript to collect the data? If the former, how do I use Python with react native, and if the latter, what Raspberry Pi library can I use with JavaScript?
Related
So what I have right now is:
A Raspberry Pi 3B+ and an Arduino Uno connected by serial communication
A react native expo mobile application
Firebase real-time database
For the Raspberry Pi and Arduino, the raspberry pi executes a python code that runs the Arduino code that takes values from a sensor connected to the Arduino Uno.
What I'm trying to do is use the react native app to execute the python code and store the values recorded from the sensor in the real-time database.
I've been searching all sorts of documentation and videos, but could not find something that relates to what I'm trying to do.
If anyone could give me a lead on how to approach this subject, it would be much appreciated.
Do let me know if any of you need any more clarification on the subject.
Actually, The data pipeline is as follows. I know that there is a firebase library for both python and react native. Using this library, connect to firebase realtime and make the necessary data pipeline.
I've built an expo app using expo location and react native maps libraries. I connect an external GPS via Bluetooth to my phone. Then the accuracy reading in my app becomes fixed at 5 meters. I don't know if my app is using the readings from external gps or internal gps (phone's gps). Is there a way to get readings from external gps into my app?
Look at the sampling rate. Which phone? iPhone is 1hz I believe.
I'm currently building an app that requires a live stream integration from a Raspberry Pi connected to a camera module into a React Native Expo Cli app. Since I'm particularly concerned about latency, I'm not sure what the best method is for streaming video. Currently I've found https://mux.com/ which would require setting up a server on the pi. Does anybody have any suggestions?
My goal is to setup my Raspberry Pi 4 to be able to run scripts when a button is clicked in an app I am making with React Native. I need to be able to do it so that they can connect without wifi, which is why I have decided to use Bluetooth.
So far I have an RFCOMM server set up on the Pi, and have installed the react-native-ble-plx module to be able to handle bluetooth communications, but I'm not sure how to get React Native to connect to this server.
I'd really appreciate it if anyone can tell me how to connect them and send data to the Pi to get it to run terminal commands, and return the result.
There are two types of Bluetooth that are not compatible with each other. RFCOMM and BLE will not work together.
On the Raspberry Pi you need to create a GATT server. RPi uses the BlueZ stack and they have an example in their source tree:
https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/test/example-gatt-server
You will also need to have an advertisement so that your phone can find the gatt server. There is also an example of that: https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/test/example-advertisement
Another suggestion is not to try and develop both ends of the Bluetooth link at the same time as that is tricky. Use a generic BLE tool to check you have the server working correctly before you develop the react app.
Network throughput in Reactnative
I am developing a video streaming App using ReactNative. The App fetches the video frames in the JS layer and sending it native module to render.
App uses the https://www.npmjs.com/package/react-native-tcp to fetch the video data over the network.
What we have found was that App is unable to fetch enough data in Android OS and where as in iOS it performs better.
Is this known issue of the TCP/IP module in the Android platform?
Wrote the same functionality in C code and App could fetch much more data over the same network compared to JS.