• Boat Banter

It is currently 01 Jul 2025, 06:26
  • View new posts
  • View unanswered posts
  • Who is online
  • In total there are 2 users online :: 0 registered, 0 hidden and 2 guests (based on users active over the past 5 minutes)
  • Most users ever online was 1736 on 21 Nov 2020, 15:51
  • Users browsing this forum: No registered users and 2 guests

Boat Projects Forum

Regal 2250 - Remote boat monitor

by mlines » 08 Jun 2015, 08:30

Well no boating at weekend due to visitors and Elaine's birthday.

However a bit more fiddling with the GSM hardware and it is now working. The Arduino processor is now reading the temperature and humidity and forwarding via GPRS over the Internet to my website, live data can be seen here.....http://www.sportsboat.org.uk/index.php/live-data

The GSM module also SMS texts me for major status changes from the processor.
Regal 2250 - "Witch Way" - MMSI:235073628
My Regal 2250
User avatar
mlines
Sub Lieutenant
Sub Lieutenant
 
Posts: 625
Joined: 25 Nov 2014, 17:54
Location: Wokingham, Berkshire

by mlines » 28 Oct 2015, 09:08

Progress has not been quick on the build as, although it was quick to get it initially working, it has been more difficult to get it to the point where it is becoming stable enough to support unattended operation.
Typically it would run for a few hours or even a day and then stop updating the web database. There was no clear reason for it stopping and it often appeared to be running ok based on the local display I had attached.
However over the weeks I have found (and cured)

1. Power issues. The SIM900 GSM card will suddenly spike at close to 2 Amps current during operations. This is because some actions require it to up the GSM transmit power (such as when changing or connecting to a cell). This spike on the low voltage, low current processor based Arduino board would cause it to crash

2. GSM library issues. When compiling the Arduino code you have to include libraries that drive the GSM card. Lots of libraries exist but many have flaws in them. It took me a while to work this out as it is difficult with many of them to actually see the command interaction going on with the GSM card. Once I managed to get a trace working I could see that the libraries could not cope with all the different states of the GSM connection. If the states went in a nice linear fashion then it was ok i.e enable GSM login, login to GSM, open connection instance, transmit on connection instance, close connection instance. However if a failure occured such as when getting to the transmit data stage the connection (which was previously set up ok) had dropped then it could not go back in the linear flow to re-establish the connection. Therefore I needed to create a mini-state engine in the code to deal with the different states. Not being a natural programmer this has taken me some time!

3. Processor memory. I started of with an Arduino UNO which only has a small amount of memory (2k SRAM). Whilst this is more than suitable for fairly sophisticated code, my code has a lot of strings in it (the modem AT commands) and strings are greedy on memory. There are coding ways around this (using Flash memory for strings) but eventually I added on an ATmega2560 piggy back board to change the CPU and give me 8k of SRAM.


So it is now on "soak test" to see how long it runs.

Image
Regal 2250 - "Witch Way" - MMSI:235073628
My Regal 2250
User avatar
mlines
Sub Lieutenant
Sub Lieutenant
 
Posts: 625
Joined: 25 Nov 2014, 17:54
Location: Wokingham, Berkshire

by Ianfs » 28 Oct 2015, 12:06

I'm proud to say that I understood every bit of Number 1, the rest of it went straight over my head! :? :D

No really, I got some of it, but you must have infinite patience Martin to work out the libraries and the code strings, amazing.

Trying to work out and find which CSS code to alter for this site and trying to understand Joomla wording is frustrating enough.

Doing what you're doing must be like learning Chinese and trying to find Waldo at the same time. :mrgreen:
Ianfs
Captain
Captain
 
Posts: 2059
Joined: 24 Nov 2014, 18:40
Location: Hampshire, by the Sea

by _Ed_ » 28 Oct 2015, 17:46

Neat :) I'm liking this little project :) What are you doing for power management? You could probably put it to sleep on interrupts for some of the sensors, depending on what your using. Make it last for months+ on a single charge. Interesting that the GSM card took 2 amps. Thats really quite a substantial amount of power, but I guess if its 3.3v thats only a few watts.
www.aboardmyboat.co.uk - boat projects and stuff!
_Ed_
Elite Engine tuner
Elite Engine tuner
 
Posts: 339
Joined: 25 Nov 2014, 02:33

by Ianfs » 28 Oct 2015, 20:14

Interesting that the GSM card took 2 amps. Thats really quite a substantial amount of power, but I guess if its 3.3v thats only a few watts.


6.6

Do you think the current draw because of the strings could be cut down with a more consolidated code?
Ianfs
Captain
Captain
 
Posts: 2059
Joined: 24 Nov 2014, 18:40
Location: Hampshire, by the Sea

by annageek » 28 Oct 2015, 20:23

How on earth did you discover the GSM thing pulling those 2A peaks? I can imagine they happen so infrequently making them a pig to capture!
annageek
Chief Petty Officer
Chief Petty Officer
 
Posts: 133
Joined: 27 Nov 2014, 21:54

by _Ed_ » 28 Oct 2015, 23:51

Would be quite easy with a good scope and a low value resistor.. You would need to know what your looking for however so nice question. I know the GSM transceivers can transmit with quite a surprising amount of RF power, and RF stuff is rarely better than 50-60% efficient.
www.aboardmyboat.co.uk - boat projects and stuff!
_Ed_
Elite Engine tuner
Elite Engine tuner
 
Posts: 339
Joined: 25 Nov 2014, 02:33

by mlines » 29 Oct 2015, 08:58

I could claim some sophisticated instruments and mathematics but instead I used the "Google" measuring instrument.....

http://wiki.iteadstudio.com/SIM900/SIM9 ... tem_Module

I quickly realised that the moment I issued the GPRS connect command to the GSM module, all the other modules would enter a power reset. This is the point where the transmitter would enter into a burst of data transmissions to establish the connection. The little badly regulated PSU that the Arduino module is supplied with could not cope.

But yes, I could have borrowed my friends ebay Chinese logging data scope and captured the spikes. And Ed is correct that RF transmitters are pretty inefficient and you can get them as low as 30-40% efficient and that excludes the microprocessing that goes on around it. Whilst RF is now only a hobby for me (G1SEO) it was a career in my early days at Heathrow.

Ed - there is a lot of discussion on the Internet around the power management of these little devices. These include "putting it to sleep" and only waking it up when you want to record sensor information. However it is my intention to only run it when on shorepower (well, a charger on an extension cable), therefore it is not going to impact the boat batteries. It will monitor the boat battery (Anna - not a clever monitor that you would want, just a voltage report) and also the shore power, it will both text me and report to me via the web page and my Pebble watch.

Whilst this seems quite technical on my behalf it is really more like building Lego. Other people have developed and written the modules (bricks) and I am just assembling into the solution I require. Therefore I have taken the GSM driving module, a Joomla website plugin, a Pebble watch module etc. etc. and glued them together to make what I want. The issues I am having is that the modules all require a little customisation and that is pushing my ability to code.

Sadly I noticed it locked up again overnight so I still have debugging to do.
Regal 2250 - "Witch Way" - MMSI:235073628
My Regal 2250
User avatar
mlines
Sub Lieutenant
Sub Lieutenant
 
Posts: 625
Joined: 25 Nov 2014, 17:54
Location: Wokingham, Berkshire

by mlines » 06 Nov 2015, 08:18

Getting close now!

All mounted in a box and code is running well. Just need to sort the external voltage connections to the batteries and then put on test again.

Regal 2250 - "Witch Way" - MMSI:235073628
My Regal 2250
User avatar
mlines
Sub Lieutenant
Sub Lieutenant
 
Posts: 625
Joined: 25 Nov 2014, 17:54
Location: Wokingham, Berkshire

by BruceK » 06 Nov 2015, 20:04

That's a fascinating bit of kit. I'd love to get my hands on one if it could tell me what the estuary is doing during the storms. That's the biggest worry I have. Waves knocking the fenders out and the boat slamming into the harbour pontoon.
BruceK
 

PreviousNext

Return to Boat Projects Forum

User Menu