B4J Question Data acquisition with Raspberry Pi

Mark Read

Well-Known Member
Licensed User
Longtime User
I am looking to built a data acquisition system for a sensor. The whole system needs to be hand-held as my laptop solution is too cumbersome. The hardware comprises:

Gill Instruments Wind Sonic Sensor for wind speed and direction mounted on a track.
Raspberry Pi with 5" TOuchscreen and Raspian from Noobs.

The sensor is connected via a RS232 port and delivers every second the "string" eg.

<STX>Q, 229, 002.74, M, 00, <ETX> 16 where 229 is the direction from North and 002.74 the speed in m/s. It is possible to read data with hyperterminal but I would like a UI.

I need a simple UI with a Start/Stop button, an edittext field for filename (or I could use a date/time stamp) and two labels for the values. No other graphics are required. The data should be saved to a text file to be processed later (date, time, direction, speed).

I have no experience with B4J but have been going through the examples.

Is my idea possible with B4J? Has anyone any advice. Should I also use a serial board on the Pi as the Pi uses 3.3V as far as I know and a normal Com port 5V?

I would be grateful for any help or hints how to proceed.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Yes, it is possible. You can use the jSerial library together with asyncstream to read the data.

You have two options for the UI:
1. Use Java 8u6: https://www.b4x.com/android/forum/t...b4j-from-the-scratch.59784/page-2#post-382028
This is the last version that supports JavaFX on ARM boards. You will need to use SceneBuilder to make the layout.

2. Create a WebApp that handles the data. You will be able to connect to the server with any browser (including the local browser). I think that this is the better option.
 
Upvote 0
Top