OpenMarine

Full Version: [SOLVED] restart Signal K from script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi Sailoog,

I know you are really busy right now with the new hats, so just a quick question:
To get correct reading from 1W temp sensor I have to restart Signal K, about 30 sec after booting. I would like to automatize this in order to have it running headless.

So my question is if I can just kill Signal K with a kill `pidof npm` and restart with the commandline I see on ps ax, or do I have to take care of a special environment?

Thanks in advance
Christian
why do you need to restart SK?
"I have to restart Signal K, about 30 sec after booting."

you need to wait longer i have done the same thing, sk needs some time .i replaced the startup sound in op with a mp3 i like, when the songs done everything is reporting right in sk,
(2018-04-09, 08:23 PM)jim321 Wrote: [ -> ]"I have to restart Signal K, about 30 sec after booting."

you need to wait longer i have done the same thing, sk needs some time  .i replaced the startup sound in op with a mp3 i like, when the songs done everything is reporting right in sk,

well, I waited a couple of minutes, but nothing settles down correctly - I have to restart SK manually to get correct readings.

@Sailoog: I have a 1W-temp sensor (DS18B20) on exhaust, whose reading is translated by NMEA-Generator to $OCMTW-Sentence, which in turn is send to the cockpit instrument.

After a fresh boot, the reading for 1W-temp on NMEA diagnostic output is -273.1 - the cockpit instrument won't show anything as this value is out of range. I need to restart SK manually - round about 30sec to 1 min after boot - to get correct values, e.g. 15.3°C on a cold motor.
As I want OP to run completely headless, I need to automate this restart - that's why I asked for a "how-to"

thanks a lot
Christian
(2018-04-10, 04:47 PM)CVL Wrote: [ -> ]
(2018-04-09, 08:23 PM)jim321 Wrote: [ -> ]"I have to restart Signal K, about 30 sec after booting."

you need to wait longer i have done the same thing, sk needs some time  .i replaced the startup sound in op with a mp3 i like, when the songs done everything is reporting right in sk,

well, I waited a couple of minutes, but nothing settles down correctly - I have to restart SK manually to get correct  readings.

@Sailoog: I have a 1W-temp sensor (DS18B20) on exhaust, whose reading is translated by NMEA-Generator to $OCMTW-Sentence, which in turn is send to the cockpit instrument.

After a fresh boot, the reading for 1W-temp on NMEA diagnostic output is -273.1 - the cockpit instrument won't show anything as this value is out of range. I need to restart SK manually - round about 30sec to 1 min after boot - to get correct values, e.g. 15.3°C on a cold motor.
As I want OP to run completely headless, I need to automate this restart - that's why I asked for a "how-to"

thanks a lot
Christian

I'm having a similar problem with converting my heading sensor as well as temp and pressure from a BME280 to NMEA sentences. When I start it up everything reports back zero to OpenCPN as well to my Elite 7 Ti plotter/finder. If I VNC into the Pi, and do an SK diagnostic the values are correct in Signal K just not being translated to NMEA but if I restart the Signal K then everything works as designed and is stable.

Since I always run a Windows tablet it's not a real big deal, just an extra minute of setup time when I first get on the water but it makes an otherwise professional type setup (I even have a Pimoroni On/Off Shim installed for push button foolproof start up and shutdown) kind of unprofessional and being a professional engineer it's driving me crazy and kicking in my engineering OCD ....... 

Just for the record my setup consists of a dAISy AIS hat and a NEO M8N GPS module in one box fed with a 1 ft cable to an FT232 USB serial converter on a Pi3, a 9 DOF IMU and a BME280 temp humidity pressure sensor mounted in a Stevenson Screen fed to the Pi with another 1 ft cable and the NMEA in/out from my Lowrance Elite 7 Ti finder/plotter fed to a pair of RS-422 to USB converters which sends heading, GPS and AIS to the finder and receives depth (DBT, DPT) and water temp (MTW) sentences from the finder.  I'm using 4 conductor plus drain shielded data cable and 4 pin aviation plugs and jacks to tie everything together and everything is in custom designed 3D printed white enclosures. 
I found a slightly faster workaround. Connect via VNC and then hit the 'play' button up on the toolbar. That seems to restart OpenChartplotter. It should also make it possible to make a shell script to automate the process either running 'x' amount of time after startup or I think I'd like it to do it after it senses GPS lock
I think by "wait" they may mean a startup delay before launching signalk. I think I have 10 seconds and it cured some ills.
(2018-05-25, 06:03 PM)Saqqara Wrote: [ -> ]I think by "wait" they may mean a startup delay before launching signalk. I think I have 10 seconds and it cured some ills.

That's basically what I ended up doing, I went to the 'startup' tab and enter 10 in the 'Delay" box. Works like a charm every time now. I just didn't notice that was there until a couple of days ago. It's getting the final installation in my boat this weekend. Mine is a bit unique because I'm an inland fisherman who makes custom depth maps and habitat maps with sidescan overlays and since I also spend a lot of time on the Mississippi River I also have an AIS receiver to track barge and large riverboat activity especially when I'm targeting the tips of wingdams and channel drop off ledges. I also like to track weather data in my fish catch logs. So I'm using OP to tie all this together along with a Lowrance finder/plotter and sending everything a Windows 10 tablet for logging and processing