Android Question [Things project] Remote scale monitor

Adie

Member
Licensed User
Longtime User
Firstly, this is not a question nor a 'my creation' It is more to show I solved the problem and where I'm heading with B4A. Hopefully it will help other developers looking at Google Things and B4A to develop technical software.

Background. I develop automation software in C++. The final product is installed on an Intel NUC connected to an ICP-CON multi port unit and then to a Delta PLC. Up to 8 RS232/485 scales can be read and all logic input and output is via the PLC.

The Project. We are looking for a more cost effective solution to service smaller plants. We looked at a standard 7" Android tablet connected to a specially designed interface for the scales and PLC. Due to the limited connections via USB on an Android device (OTG ready etc) as well as all the unnecessary software on Android it turned out not to be the best option. A range of other options were evaluated but noting could match Android and B4A. The Raspberry Pi was the hardware of choice but Linux was out. (I am waaayyy to stupid for that 'Geekspeak') We considered various Android builds that could work on the Pi - even Win10 IoT. None ticked all the boxes on our checksheet.

And then came Google Things.
After a few days we got the Pi up and running and connected. It was possible to use my C++ dev system to do a few tests but it was slow and the APK was BIG. Back to B4A. It took a while to get everything up and running. this was mostly because I did not (still don't) understand how this lot go together.

Time was running out as I had to deliver a remote (wireless) scale display with high and low alarm set-points. Now 3 days later I just need to put the units in the enclosures.

This project also formed the stepping stone for the full HMI - PLC project.

Project overview.
Read any type of scale via radio (too far for Bluetooth) modem. The user must set the limits and an alarm must sound if exceeded. We designed a RS232 to TTL converter and mounted that with the modem in a small DIN rail mount enclosure at the scale. The other side is the modem connected directly to the I/O bus of the Pi. Full error trapping between the scale and the Pi had to be included like 1) Lost connection, 2) Scale overload, 3) wrong scale settings etc etc.

During my searches on this forum it was mentioned a few places that the Pi can use the 7" display but not the Touch panel. The latest Things and B4A lib is 100% touch ready. Due to limitations Google put on Things there are some functionality missing - see the google docs. At this stage I could not get any Android keyboard to pop up. I created my own keyboard and change the EditText to Label so I can get a Click event. the next step is to create a library from the popup keyboard. (I do not like any available virtual keyboards out there) Never even tested a 'real' keyboard as it will not be used.

Attached a few images of the software on the Pi.

Adie

normal.JPG
No Scale.JPG
over limit.JPG
Setpoint.JPG
 
Top