question

ming avatar image
ming asked

GX LTE 4g and modbus - error 153 --- SOLVED ---

Hello,


I have a setup with an Cerbo gx conected to a PLC using modbus TCP through ethernet. This is working perfect.

Now I have the following problem: I recently connected a Victron GSM LTE 4G modem to this setup and this will only work when I disconnect the ethernet cable to the PLC. How can I make this work together?

Apparantly the Cerbo prioritises the WIFI and ethernet connections over the modem (usb) connection. Is there any way to change this? Is there any way to change the high routing metric in the Linux kernel?

Any insights and help would be greatly appreciated!


Thanks


Daan

cerbo gxModbus TCP
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

6 Answers
ming avatar image
ming answered ·

First of all, I'm new to posting on websites like this, so let me first apologise for any noob mistakes....


I've entered a rabit hole of sorts, which keeps on getting deeper and deeper, as I spend the last few days, at least 6 hours per day on this (learning Linux mostly). I'm on holiday so I have the time, although the frown in my girlfriends forhead seems to grow by the day....

So, with a bit of help from the dealer where I bought this unit from, I got a starting place:

I've tried changing the metric in the <interfaces> file ( etc/network/interfaces ).

But, of course, this doesn't work (why can't it be easy sometimes?)....

Also, this file seems to be edited by "connmen", and as far as my knowledge of Linux goes (which isn't far...), it seems he has changed the code in this file for "comment" because of the # at the start of each line and the top comment "outcommented by connman" (tried to highlight it, hope it's clear), which probably means he used this as an easy way to disable this code (theory).rabit-hole.jpg

And now I wonder who this connman is, and what he is doing on my Cerbo? It actually reminds me of an old joke: who is general Failure and why is he reading my harddisk? Sorry, I digress .


So I added the metric line you also see in the screenshot, but this doesn't work.... I also tried putting the metric in other, logical places in the script but no dice....


Back to this connman (my mother always told me to never trust conman, does the extra n make a difference?)

Apparantly he also has his own directory in the file system, which has a config file:

rabit-hole-2.jpg

I've also tried changing the sequence of the technologies in that file, as you can see in the screenshot above, but again, no dice.

So my guess is this metric is configured somewhere else, but where?

I'll start searching some more the coming days, but if anybody knows where I should look, please share.


Again, any insights or remarks would be greatly appreciated!


I'm off to a restaurant.


Daan


rabit-hole.jpg (121.6 KiB)
rabit-hole-2.jpg (68.3 KiB)
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

ming avatar image
ming answered ·

Well, I've got it to work. Spent quite a lot of time on it but that doesn't matter as i've gotten positive results....

Basicly you need to add 2 lines of code in two files:


Step 1

Add " DefaultFavouriteTechnologies=Celular " in the " main.conf " file which is the configuration file for connman (connection manager, how could I have missed that....?)

I've also changed all the prefered technologies in this file to cellular.


werkend-standaard.jpg

Step 2

Add " route add default dev ppp0 " to the " ip-up " file located in " /etc/ppp " directory.

werkend-2.jpg

Step 3

Reboot (for the changes to load)


Step 4

Disconnect the ethernet cable on the cerbo device for about 30 seconds for the unit to switch to cellular.


Obviously still feels a bit like a sketchy solution because it doesn't work automaticly but if this annoys me enough I might go hunting for a solution for this. For now it works for me and I'm happy.


Grtz


Daan


werkend-standaard.jpg (103.8 KiB)
werkend-2.jpg (165.9 KiB)
1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

trevora avatar image trevora commented ·
Hi ming

Is your method still working reliably for you?

0 Likes 0 ·
mvader (Victron Energy) avatar image
mvader (Victron Energy) answered ·

Hi!

Sounds like you spend a lot of time on this! Here is how to do it in a simpler manner:


The solution (I’ve not tested this yet) is to configure the ethernet connection without (default) gateway.

So for a DHCP network, where another device hands out the ip addresses and related configuration, typically a router, configure that to not specify a gateway. Like here:

img-0051.jpeg


That way, no special code or modifications - which will also make it har ld to install regular updates - are required.


Hope that helps!


Ps. Note that modem is never managed by
connman regardless of what you put in those config files since we build/compile Connman without support for that.





img-0051.jpeg (327.4 KiB)
8 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

mvader (Victron Energy) avatar image mvader (Victron Energy) ♦♦ commented ·
Ps. We’ll be working on the documentation to better explain this.


First round of improvements is in already I think.

0 Likes 0 ·
Show more comments
cika8 avatar image
cika8 answered ·

Hi!

If would be nice to add ability in Venus OS to set priority between internet adapters (Ethernet, WiFi or 4G LTE dongle).
We have power hybrid systems on mountains (PV panels, MPPT controllers, MultiPlus II, Generator and LiFePO4 batteries). 4G LTE USB adapter is used for internet connection.
We are trying to implement Modbus between Cerbo GX and Generator ComAp controller. For that case, SIM router is needed (for local network between Cerbo GX, ComAp and for internet access) and it has AC/DC power adapter.
In case of MultiPlus II failure or RCD trip, remote monitoring and control will not be available anymore, until someone goes to the mountain and check what is going on. Going to the mountains, especially in winter season could be very problematic.
The best option will be that 4G LTE adapter is primarily used for internet connection and common router with AC/DC power adapter for Modbus. In case of AC side failure we could, at least, have remote monitoring and control without modbus. In that case it will be obvious that something is wrong with AC side or router. It is good that Cerbo GX and 4G LTE adapter work on DC side, especially because of power from batteries.

Please, think about this proposal. I will test @mvader (Victron Energy) solution. :)

Best regards.

1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

If you use a simple switch instead of a router, and then do manual configuration and leave the gateway to 0.0.0.0, or use something with dhcp but make sure as part of the dhcp there is no default gateway set, I’m 99% sure it will work.


Local ethernet connectivity, and internet to the GX via the Victron GX LTE 4G modem.

0 Likes 0 ·
cika8 avatar image
cika8 answered ·

Good evening,

I tried @mvader (Victron Energy) steps, but it didn't work for me. Tried to reset router, and Cerbo GX - still the same. :(

VRM portal doesn't get fresh informations from Cerbo GX and there is no access to the Remote Console. When UTP cable is removed - everything works through 4G LTE adapter.

2 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Can you post a screenshot of your ethernet settings?
0 Likes 0 ·
cika8 avatar image cika8 mvader (Victron Energy) ♦♦ commented ·
Hi @mvader (Victron Energy) :)


Sorry for late reply.

We swapped GX LTE 4G dongles with MikroTik hAP ax lite LTE6 routers and powered them from 48VDC link (batteries + MPPTs + MultiPlus II) with via 5VDC DC/DC converter and USB type C cable. Cerbo GX is running now on Ethernet.

I'm unable to help, because we don't have any configuration which includes GX LTE 4G dongles.


Best regards,

Srđan


0 Likes 0 ·
chickennuggets avatar image
chickennuggets answered ·

@Ming mutch respect your way for the amount of work you put in to solve your problem.

well done.

having the time to learn linux to solve a problem, i envy that.

also, the general failure joke, i chuckled, screenshot, highlighted and sent to a friend i havent spoken to in years. thanks for that.

no input from me, just have a great day.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.