|
Post by alexfish on Mar 6, 2021 22:47:26 GMT 1
Hi All ounce the kit is sorted, then it be used on the boat So in terms of Show us your hardware: Don't think it be any anything like Rikky's with a place to make boats and nav room so here is what the bits are going on , I have one of These Mitchell 31BR Alex
|
|
|
Post by alexfish on Mar 7, 2021 0:51:27 GMT 1
Hi Rik & all
possible see why getting opencpn a problem
latest Buster PI4 ios images march 2021
cut short here :: opencpn web site PHP version
this how I got opencpn in
latest vesion of rpios / march for raspberry pi4
sudo nano /etc/apt/sources.list add for Buster
deb http://ppa.launchpad.net/opencpn/opencpn/ubuntu/ bionic main save the file and exit then
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C865EB40 sudo apt-get update sudo apt-get install opencpn
BR Alex
I added the ttyUSB0 and correct buad rate for my device & viola
BR Alex
|
|
|
Post by rikky on Mar 7, 2021 8:29:10 GMT 1
Looks like you don't have a problem with Brexit. I'm overwhelmed by this new Operation System from OpenPlotter. OpenCpn pre installed is just for starters. A lot of crap that you don't need isn't there, and a lot of things I never heard about, but always wanted is pre configured and ready to use. KPlex it is, NOT SignalK, that multiplexes all your data, like the AIS etc, etc A VNC thing to which you can log in remotely to openplotter.local, that I never succeeded to get to work, is preconfigured and ready. A WiFi repeater build in, that can talk to you (your devices) and with for example the Marina, to pass trough the internet, but also apparently to pass through just OpenCpn Did not even know this was possible. I thought you can either connect to a Marina OR connect to your devices, NOT both at the same time. Have NOT tested your gps program though, for I am too scared to break anything. I'm too happy to have something running, without having to buy a big laptop. will prepare an other Raspberry for testing and messing around with soon.
|
|
|
Post by rikky on Mar 7, 2021 11:52:41 GMT 1
Oke my mistake. Kplex is not even installed on my system. In SignalK you can register your AIS, with everything like port /dev/ttyUSB0 baudrate And then it sends the data over the internet at 10.10.10.1:3000 Then on another device you install OpenCpn and configure your AIS port comming from 10.10.10.1:3000 Don't know if it works, but it works using localhost:3000 on the same machine. Haa, now you have your AIS computer headless
|
|
|
Post by alexfish on Mar 7, 2021 14:50:03 GMT 1
Will try to install Signal-k
did some further reading ,it looks interesting
BR Alex
|
|
|
Post by alexfish on Mar 7, 2021 16:29:43 GMT 1
Well Followed the instructions to a T
Got the usual warnings then at the end and in short these are the last bits , but it seems to connect
pi@raspberrypi:~ $ sudo npm install -g --unsafe-perm signalk-server npm WARN deprecated debug@4.2.0: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797) npm WARN deprecated core-js@2.6.12: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
added 545 packages, and audited 546 packages in 3m
24 packages are looking for funding run `npm fund` for details
4 high severity vulnerabilities
To address all issues, run: npm audit fix
Run `npm audit` for details. pi@raspberrypi:~ $ signalk-server --sample-nmea0183-data Settings file does not exist, using empty settings Using sample data from /usr/local/lib/node_modules/signalk-server/samples/plaka.log *** WARNING *** The program 'node' uses the Apple Bonjour compatibility layer of Avahi. *** WARNING *** Please fix your application to use the native API of Avahi! *** WARNING *** For more information see <http://0pointer.de/blog/projects/avahi-compat.html> *** WARNING *** The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi. *** WARNING *** Please fix your application to use the native API of Avahi! *** WARNING *** For more information see <http://0pointer.de/blog/projects/avahi-compat.html> signalk-server running at 0.0.0.0:3000
Tried the audit fix and got this
npm audit fix npm ERR! code ENOLOCK npm ERR! audit This command requires an existing lockfile. npm ERR! audit Try creating one first with: npm i --package-lock-only npm ERR! audit Original error: loadVirtual requires existing shrinkwrap file
npm ERR! A complete log of this run can be found in: npm ERR! /home/pi/.npm/_logs/2021-03-07T15_30_38_866Z-debug.log
Finally sorted
pi@raspberrypi:~ $ npm i --package-lock-only
up to date, audited 1 package in 5s
found 0 vulnerabilities pi@raspberrypi:~ $ npm audit fix
up to date, audited 1 package in 1s
found 0 vulnerabilities
BR Alex
|
|
|
Post by alexfish on Mar 7, 2021 23:28:58 GMT 1
Hi All
have modded the serial port to use exec$ to receive the decode NMEA see first post Adapt paths to suit . the decoder name here is gpsdc at the EXEC$ in tha Function callback
the serial driver Adapt Paths cssl.h and the cssl.c
Adapt the serial port and baud rate to suit BR Alex
PRAGMA INCLUDE /home/pi/Downloads/libcssl-0.9.4/cssl.h PRAGMA INCLUDE /home/pi/Downloads/libcssl-0.9.4/cssl.c
PRAGMA OPTIONS -D_GNU_SOURCE OPTION PARSE FALSE DECLARE serial TYPE cssl_t * DECLARE finished DECLARE NMEA$ TYPE STRING
SUB callback(int id, unsigned char buf[], int length) LOCAL cmd$, RES$, GPRMC$ TYPE STRING
FOR i = 0 TO length-1 NMEA$=NMEA$ & CHR$(buf[i]) IF ASC(CHR$(buf[i])) = 13 AND ASC(CHR$(buf[i+1])) = 10 THEN IF INSTR(NMEA$,"GPRMC") THEN GPRMC$= CHOP$(MID$(NMEA$,INSTR(NMEA$,"$"))) 'PRINT GPRMC$ cmd$ = "./gpsdc '" & GPRMC$ & "'" RES$= EXEC$(cmd$) PRINT RES$ END IF NMEA$="" END IF
NEXT
END SUB
cssl_start()
' change device port and baud rate baud serial= cssl_open("/dev/ttyUSB0",(void*)callback,0,38400,8,0,1)
IF serial = 0 THEN
LOCAL msg$ TYPE STRING msg$ = cssl_geterrormsg() PRINT "failed :", msg$ END -1
END IF
WHILE NOT(finished)
SLEEP 1 WEND
PRINT NL$, "^D - we exit", NL$
cssl_close(serial) cssl_stop()
|
|
|
Post by alexfish on Mar 8, 2021 1:12:31 GMT 1
Before I broke the sim card I had download a ais decoder in c , it would not compile an hence set a thread Navigation(ais) to use the gpsd Downloaded again and have done some mods to the source code , now it compiles so will be testing that + working on the gui in mean time as regard equipment and access ,, these devices are generally available with usb or can use rs to usb,, as mentioned by members can only access one bit at time and some ideas about network I leave you with some food for thought USBIPwww.linux-magazine.com/Issues/2018/208/Tutorial-USB-IPBack soon BR Alex
|
|
|
Post by alexfish on Mar 8, 2021 9:23:57 GMT 1
The source Link for AIS NMEA at GitHub HEREmay compile on earlier gcc wont compile the casting hit:: think c++ :: a=(foo)(bar) thinking, maybe soon going Rusty BR Alex
|
|
|
Post by rikky on Mar 8, 2021 10:24:20 GMT 1
Interesting this usb_ip Will read about it later. But still you can open your device only for one user. Wether locally or remote. So tried this from another Raspi (Told you not to throw away your old Raspi 3('s)) curl -s GET openplotter.local:3000/signalk/ response: So we have Don't know what ws:// means or what to do with the tcp or how to use the severnode (yet) curl -s GET openplotter.local:3000/signalk/v1/api/ result: a horrible lot extract from the result: UNJSONED result "vessels": "urn:mrn:imo:mmsi:205068000": "mmsi":"205068000" "navigation": "speedOverGround": "meta": "units":"m/s" "description":"Vessel speed over ground. If converting from AIS 'HIGH' value, set to 102.2 (Ais max value) and add warning in notifications" "value":3.2410008210535413 "$source":"AIS.AI" "timestamp":"2021-03-08T08:44:59.972Z" "sentence":"VDM" "courseOverGroundTrue": "meta": "units":"rad" "description":"Course over ground (true)" "value":0.31415926543071115 "$source":"AIS.AI" "timestamp":"2021-03-08T08:44:59.972Z" "sentence":"VDM" "headingTrue": "meta": "units":"rad" "description":"The current true north heading of the vessel, equals 'headingMagnetic adjusted for magneticVariation'" "value":0.33161255795463956 "$source":"AIS.AI" "timestamp":"2021-03-08T08:44:59.972Z" "sentence":"VDM" "position": "meta": "description":"The position of the vessel in 2 or 3 dimensions (WGS84 datum)" "properties": "longitude": "type":"number" "description":"Longitude" "units":"deg" "example":4.98765245 "latitude": "type":"number" "description":"Latitude" "units":"deg" "example":52.0987654 "altitude": "type":"number" "description":"Altitude" "units":"m" "value": "longitude":3.79455 "latitude":51.16985 "$source":"AIS.AI" "timestamp":"2021-03-08T08:44:59.972Z" "sentence":"VDM" "state": "meta": "description":"Current navigational state of the vessel" "value":"motoring" "$source":"AIS.AI" "timestamp":"2021-03-08T08:44:59.972Z" "sentence":"VDM" "specialManeuver": "meta": "value":"not available" "$source":"AIS.AI" "timestamp":"2021-03-08T08:44:59.972Z" "sentence":"VDM" "destination": "commonName": "meta": "description":"Common name of the Destination, eg 'Fiji', also used in ais messages" "value":"HARBOUR TOWAGE" "$source":"AIS.AI" "timestamp":"2021-03-08T08:07:26.635Z" "sentence":"VDM" "sensors": "ais": "class": "meta": "description":"AIS transponder class in sensors.ais.class, A or B" "value":"A" "$source":"AIS.AI" "timestamp":"2021-03-08T08:44:59.972Z" "sentence":"VDM" "fromBow": "meta": "description":"The distance from the bow to the sensor location" "value":16 "$source":"AIS.AI" "timestamp":"2021-03-08T08:07:26.635Z" "sentence":"VDM" "fromCenter": "meta": "description":"The distance from the centerline to the sensor location, -ve to starboard, +ve to port" "value":-1 "$source":"AIS.AI" "timestamp":"2021-03-08T08:07:26.635Z" "sentence":"VDM" "name":"RT PETER" "design": "length": "meta": "description":"The various lengths of the vessel" "properties": "overall": "type":"number" "description":"Length overall" "units":"m" "hull": "type":"number" "description":"Length of hull" "units":"m" "waterline": "type":"number" "description":"Length at waterline" "units":"m" "value": "overall":32 "$source":"AIS.AI" "timestamp":"2021-03-08T08:07:26.635Z" "sentence":"VDM" "beam": "meta": "units":"m" "description":"Beam length" "value":12 "$source":"AIS.AI" "timestamp":"2021-03-08T08:07:26.635Z" "sentence":"VDM" "draft": "meta": "description":"The draft of the vessel" "properties": "minimum": "description":"The minimum draft of the vessel" "type":"number" "units":"m" "maximum": "description":"The maximum draft of the vessel" "type":"number" "units":"m" "current": "description":"The current draft of the vessel" "type":"number" "units":"m" "canoe": "description":"The draft of the vessel without protrusions such as keel, centerboard, rudder" "type":"number" "units":"m" "value": "current":5.9 "$source":"AIS.AI" "timestamp":"2021-03-08T08:07:26.635Z" "sentence":"VDM" "aisShipType": "meta": "description":"The ais ship type see http://www.bosunsmate.org/ais/message5.php" "properties": "id": "type":"number" "description":"The ship type number" "name": "type":"string" "description":"The ship type name" "value": "id":52 "name":"Tug" "$source":"AIS.AI" "timestamp":"2021-03-08T08:07:26.635Z" "sentence":"VDM" "communication": "callsignVhf":"ORNH" "registrations": "imo":"IMO 94749170" Rik
|
|
|
Post by alexfish on Mar 8, 2021 10:42:33 GMT 1
|
|
|
Post by alexfish on Mar 8, 2021 11:02:03 GMT 1
A Simple BaCon WebServer ' Define HTTP constants CONST New$ = CHR$(13) & NL$ CONST Sep$ = CHR$(13) & NL$ & CHR$(13) & NL$ CONST Msg$ = "<html><head>BaCon web greeting</head><body><h2>Goodbye, World!</h2></body></html>"
' Get our IP Ip$ = "localhost" PRINT "Connect from browser '", Ip$, ":8080'."
' Ignore child signals to avoid zombie processes SIGNAL SIG_IGN, SIGCHLD
' Open listening port OPEN Ip$ & ":8080" FOR SERVER AS mynet
' Keep receiving requests WHILE TRUE
' Handle for newly incoming connection fd = ACCEPT(mynet)
' Incoming connection -> create background process spawn = FORK
' We are in the child IF spawn = 0 THEN
' Get the request REPEAT RECEIVE dat$ FROM fd PRINT dat$ UNTIL RIGHT$(dat$, 4) = Sep$
' Reply that we're OK SEND "HTTP/1.1 200 Ok" & New$ & "Content-Length: " & STR$(LEN(Msg$)) & Sep$ & Msg$ TO fd
' Close connection CLOSE SERVER fd
' End this process ENDFORK ENDIF WEND Need the Weather Forcast 'HTTP Weather CONST New$ = CHR$(13) & NL$ CONST Sep$ = CHR$(13) & NL$ & CHR$(13) & NL$ CONST Msg$ = "<html><head>BaCon web greeting</head><body> <br> <a href='http://wttr.in'>Weather</a> <h2>Goodbye, World!</h2></body></html>"
' Get our IP Ip$ = "localhost" PRINT "Connect from browser '", Ip$, ":8080'."
' Ignore child signals to avoid zombie processes SIGNAL SIG_IGN, SIGCHLD
' Open listening port OPEN Ip$ & ":8080" FOR SERVER AS mynet
' Keep receiving requests WHILE TRUE
' Handle for newly incoming connection fd = ACCEPT(mynet)
' Incoming connection -> create background process spawn = FORK
' We are in the child IF spawn = 0 THEN
' Get the request REPEAT RECEIVE dat$ FROM fd PRINT dat$ UNTIL RIGHT$(dat$, 4) = Sep$
' Reply that we're OK SEND "HTTP/1.1 200 Ok" & New$ & "Content-Length: " & STR$(LEN(Msg$)) & Sep$ & Msg$ TO fd
' Close connection CLOSE SERVER fd
' End this process ENDFORK ENDIF WEND From HERETo connect from your browser http://localhost:8080/ BR Alex
|
|
|
Post by alexfish on Mar 8, 2021 11:29:50 GMT 1
Possible getting a little off beat at this stage :: Add Json weather
can try
curl wttr.in/Detroit?format=j1 BR Alex
|
|
|
Post by vovchik on Mar 8, 2021 14:48:43 GMT 1
Dear Alex,
Thanks for reminding me of wttr.in. That json provides a lot of information - including forecasts and the likelihood of precipitation. Parsing those bits and formatting could give us a nice little weather app without too much work.
With kind regards, vovchik
|
|
|
Post by alexfish on Mar 8, 2021 16:40:10 GMT 1
Dear Alex, Thanks for reminding me of wttr.in. That json provides a lot of information - including forecasts and the likelihood of precipitation. Parsing those bits and formatting could give us a nice little weather app without too much work. With kind regards, vovchik the GUI .. yes my target was to use X11 and whilst on the IOT , have done a revisit of Peter's webkit widgets , HEREso thinking interfacing Peters WebServer + Peter's WebKit Widgets BR Alex
|
|