Android Question n.1 rs232 server ==>> n.X rs232 client - via internet communication

amorosik

Expert
Licensed User
I have a device, a weighing scale with rs232 output
In several different geographical places (therefore not connectable via cable) there are led numeric displays that must show information such as when it is produced by the scale
I would like to connect the 'producer' scale to the 'user' display using common Android smartphones, with otg cable and usb to rs232 converter, both on the scale side and on the display side
Basically I would like to create a system that simulates a cable and obtains the same effects that would be obtained by physically connecting the tx pin of the rs232 balances with the rx pins of the numerous displays.
What code to use to acquire the information from the source rs232, transmit it using the telephone data network, and emit it on numerous rs232 recipients?

BILANCIA_RS232_TEL_TO_DISPLAY.jpg
 
Last edited:

amorosik

Expert
Licensed User
i would never use a phone as solution, but like other fellow's already stated here rasberry can offer solutions.

In this example, raspberry or telephone are equal
And both are missing of 'reachability' (or may be 'tracing' ?) feature
The problem is not the device but a way to communicate to a mobile device connected to internet
 
Upvote 0

hatzisn

Expert
Licensed User
Longtime User
In this example, raspberry or telephone are equal
And both are missing of 'reachability' (or may be 'tracing' ?) feature
The problem is not the device but a way to communicate to a mobile device connected to internet

So I suppose regarding my previous post in the previous page that also the weighting scale/server is not in a WiFi... Right? I suppose you are in big trouble but there is a solution. Just host in a WiFi enabled place the MQTT server (with no-ip) and have also the Weighting Scale/Server connect to it.
 
Upvote 0

amorosik

Expert
Licensed User
So I suppose regarding my previous post in the previous page that also the weighting scale/server is not in a WiFi... Right? I suppose you are in big trouble but there is a solution. Just host in a WiFi enabled place the MQTT server (with no-ip) and have also the Weighting Scale/Server connect to it.

In the middle of the sea there are no wifi 'enabled places'
And if they existed, they would always be unreachable from the internet to the boat, as the connection would be made with a data telephone line.
And then the clients would fail to reach the mqtt server
 
Upvote 0

MbedAndroid

Well-Known Member
Licensed User
Longtime User
so if there is no wifi, no internet, and somewhere at sea, the only way is to look at satellite data providers. Even Lora is not a solution as the maximum range you can expect will be 1 km to 10 kms. The boeings are using a satellite data channel to forward the status reports of the engines. (That's why they got a idea which direction the lost Maylasian airplane went to after departure. )
 
Upvote 0

hatzisn

Expert
Licensed User
Longtime User
@amorosik Definitely you are in deep trouble. I 've never traveled with a ship to another country. My furthest trip with a ship is at the island of Rhodes where I served my military service. So as a result I am not able to know what a ship would do in a mid ocean position. Don't the ships have satellite connection to the internet? Don't worry though even if they have not, if you can wait a 2-3 years ;) Elon Mask will solve this problem with the 60.000 satellites he will lunch to create low latency mobile internet everywhere in the planet. This is a good and a bad thing (as if not a bunch of space garbage were orbiting the planet already) but when money is the main thinking apparatus of people, pfffff....
 
Upvote 0

amorosik

Expert
Licensed User
so if there is no wifi, no internet, and somewhere at sea, the only way is to look at satellite data providers. Even Lora is not a solution as the maximum range you can expect will be 1 km to 10 kms. The boeings are using a satellite data channel to forward the status reports of the engines. (That's why they got a idea which direction the lost Maylasian airplane went to after departure. )

Why you say "..there is no internet..." ?
Internet is present, the smartphone may connect correctly to internet
The only big problem is that ip wan address are non accessible, then communication directed from internet TO smartphone cannot find anything
 
Upvote 0

MbedAndroid

Well-Known Member
Licensed User
Longtime User
you wrote: In the middle of the sea there are no wifi 'enabled places'
but now you say there is internet. Thus via a mobile operator? Mobile operators wont allow incoming packages. Therefore you should have a look direction MQTT while this is a outgoing datachannel .
 
Upvote 0

amorosik

Expert
Licensed User
@amorosik Definitely you are in deep trouble. I 've never traveled with a ship to another country. My furthest trip with a ship is at the island of Rhodes where I served my military service. So as a result I am not able to know what a ship would do in a mid ocean position. Don't the ships have satellite connection to the internet? Don't worry though even if they have not, if you can wait a 2-3 years ;) Elon Mask will solve this problem with the 60.000 satellites he will lunch to create low latency mobile internet everywhere in the planet. This is a good and a bad thing (as if not a bunch of space garbage were orbiting the planet already) but when money is the main thinking apparatus of people, pfffff....

They are not large ships and do not travel in the middle of the ocean, but small work boats, and being always under the coast they are always covered by a telephone signal, so the internet connection is guaranteed.
I can also do without waiting 2-3 years
 
Upvote 0

amorosik

Expert
Licensed User
you wrote: In the middle of the sea there are no wifi 'enabled places'
but now you say there is internet. Thus via a mobile operator? Mobile operators wont allow incoming packages. Therefore you should have a look direction MQTT while this is a outgoing datachannel .

I wrote 'in the middle of the sea' to make it clear that we are not in a place similar to offices or similar
In reality, the sites to communicate with each other are small work boats, which travel along the coast, and are always under telephone coverage, even internet coverage is ensured by normal 2g / 3g / 4g phones
Just see the diagram in the first post, that is the example to model the available equipment

"..MQTT while this is a outgoing datachannel .." this is true for the clients but for the server it is necessary to ensure that the clients can 'enter'
 
Upvote 0

MbedAndroid

Well-Known Member
Licensed User
Longtime User
I'm using for alarmdetection RS232 modem, working with a simcard, thus via a mobile operator. I can alway access the equipment behind the modem. In your case i should forget the phone, but look a solution modem/mqtt
 
Upvote 0

amorosik

Expert
Licensed User
I'm using for alarmdetection RS232 modem, working with a simcard, thus via a mobile operator. I can alway access the equipment behind the modem. In your case i should forget the phone, but look a solution modem/mqtt

Yes also rs232/modem/3g is a good solution
Can you write factory/model ?
But rs232/modem can we communicate one-to-many (like on schema) ?
 
Upvote 0

MbedAndroid

Well-Known Member
Licensed User
Longtime User
it's a system build many years ago, and all the time in service without any issues. Those modems i use are already outdated.

But have a look at this: https://www.digikey.com/en/maker/pr...s-using-mqtt/39ed5690cc46473abe8904c8f960341f
google is your best friend, sure you can find more info about Mqtt . For the raspberry exist G3 sticks, ebay will help you to find those.
B4j is a good solution to solve your needs, and have a look and Banano. Might be Alain has implement Mqtt into Banano.
 
Upvote 0

Michael1968

Active Member
Licensed User
Longtime User
Why do you want to host the mqtt broker on a mobile device?

run all devices in client mode connect to a Mqtt broker hosted around the world.

so, then the "producer" can handle the Massages

You can test this solution with adafruite.io
 
Upvote 0

amorosik

Expert
Licensed User
Because it's one less system component
And if you could do without it, it would be better
But it seems to me that this is not possible
And then we will opt for mqtt server installed in the company systems
Always if a better system does not come up
 
Upvote 0

MbedAndroid

Well-Known Member
Licensed User
Longtime User
rasberry is a more stable platform then any android/iphone- if you are looking for 24/7 solutions.
same you archieve with anduino, but that will be more components i'm afraid.
I got 2 rasberry's running 24/7 year after year. Only issue i can image is that for some bug or other reason the java application with stop. In that case you cant access the OS with a mobile link to restart it. (from distance) but in case someone is around he can pulled the plug for a moment and restart the application.
 
Upvote 0

hatzisn

Expert
Licensed User
Longtime User
@amorosik this must be your final solution

1603019741377.png
 
Upvote 0

MbedAndroid

Well-Known Member
Licensed User
Longtime User
for what reason you still want to add phones? You can connect the weightscale to the rasp by rs232/usb cable (take the windows 10 compatible ones).
Also for the displays you add a rasberry which are clients for the MQTT and with some lines of code it will be send to the displays via rs232/usb.
if you avoid the phones you will have a 24/7 solution.
The raspberry support wifi. in fact it is the substitude and complete solution for your demand.
Same you archieve with arduino. But seen the price for a Pi and the possibilities you save a lot of work using a PI. The only issue i told you is when you have some bug in the code and the java code will crash, you can't start it from distance. (There are solutions with a watchdog solution in case of need)
 
Upvote 0
Top