speters / rs109m

RS-109M AIS net locator buoy configurator
10 stars 1 forks source link

Battery is displayed as length of ship (ref A) #4

Open eduardosarabia opened 11 months ago

eduardosarabia commented 11 months ago

Hello. Thank you for the post, There isn't enough information in the internet about this device.

Right now I'm facing a problem: i'm unable to make lenght (ref a value) a fixed value. When I write changes to the device, It looks like it's working, but when reading again, battery is again displayed in the ref a field. I have tried with the PCSW 1.9 and with your python script. Both give me the same problem.

Is there a way to make this value static? Hardware or software ways...

Thank you in advance!

speters commented 11 months ago

The factory supplied firmware uses the length value to communicate information about the battery voltage. Since there is no firmware (neither source code nor binary code) available for the onboard microcontroller, there is no good solution to this problem.

One hack would be to cut the wire coming from the battery and set the voltage divider resistors for the ADC pin to fixed resistors that correspond to a representation of the actual length of your boat.

But since this device is very buggy, you should not use it in the wild as an AIS device for your boat! In emergency situations it would not bother anyone, but normal use is a no-go.

speters commented 11 months ago

This should be the voltage divider: rs109m_voltagedivider

eduardosarabia commented 11 months ago

Thanks for your reply. So, in that case, what would I have to change? If I remove the voltage divider it would display 0 as length?

eduardosarabia commented 11 months ago

IMG20231020170235 this is my pcb

speters commented 11 months ago

On your device, this should be the voltage divider which is used to measure battery voltage: Unbenannt_voltagediv

I would remove both resistors and replace them with a trim potentiometer (and maybe a current-limiting resistor to prevent shorting the wiper to ground).

eduardosarabia commented 11 months ago

I have removed the resistor in the left and now it indicates 0 as battery!

For the moment this is enough. Now I can set length in ref B, and although the antena will not appear correctly placed in the boat now it's much more accurate. In a future I will search a potentiometer to do what you propose.

Thanks a lot!

bjoernrost commented 10 months ago

I think I have a model with a slightly newer firmware because mine reports battery charge in the UnitSerial field and does not mess with the ship dimensions.

speters commented 10 months ago

@bjoernrost did you also check if this is embedded in the VendorID field of the Static Data Report (AIS Class B message 24)? Too bad the firmware is not available...

bjoernrost commented 10 months ago

It's in the serial field of message 24:

!AIVDM,1,1,,A,H1WvccTU00000100000000000000,0*7E

decodes to this (battery at 64%):

MessageType24PartB(msg_type=24, repeat=0, mmsi=109030318, partno=1, ship_type=37, vendorid='', model=0, serial=64, callsign='', to_bow=0, to_stern=0, to_port=0, to_starboard=0, spare_1=b'\x00')

While that is good for keeping the dimensions "correct", I think it might make it harder to monitor for battery level as I don't think that most MFDs will display the serial (i'll check mine later).