|
Post by rikky on Jun 23, 2021 8:10:32 GMT 1
Thanks Vovchik, but It did not work. Apparently when you have too many boats moving around then loading all these svg's from file takes too much time. a work around is a function in Jscript. I hope I'm not kicked off the forum for replacing BaCon snippets with Jscript. And then for your moving ship: set_svgIcon_sailing(radians_to_degrees(course)); boat[i] = L.marker([latitude,longitude],{icon:svgIcon_sailing});
Now it works. Rik.
|
|
|
Post by bigbass on Jun 29, 2021 1:21:56 GMT 1
Hello Rik
It's good to see you are moving along with getting navigation working for your boat
there are many ways to solve a problem and in the end you will have to make it work the way it will be useful for you
and gives you free time to enjoy going out on the water and breathe some fresh air (and catch some fish)
thanks
Joe
|
|
|
Post by alexfish on Jun 30, 2021 20:45:41 GMT 1
Hi All Now have another USB gps gadget , in short now got access using bacon code , hooray. and the short bit of code for my device change the open "***" for your device and set the baud rate.. B*** LOCAL iter LOCAL str$ iter = MEMORY(255) OPEN "/dev/ttyACM0" FOR DEVICE AS myserial SETSERIAL myserial SPEED B115200 GETBYTE iter FROM myserial CHUNK 255 SIZE received str$= iter PRINT str$ CLOSE DEVICE myserial FREE iter also have the X11 window in position to read the bits in similar fashion to gtk if no event then ... blagh the original interface = event only interrupt . again hooray a few weeks behind .. thats life what was promised will be next week BR Alex
|
|
|
Post by alexfish on Jul 1, 2021 1:22:22 GMT 1
Hi All With using the Bacon Serial port , need a bit more control over the lines + having problems with bacon Global Declares using iter's an strings Else get multiple lines of text , also seg faults Example below : read one byte at a time FUNCTION READSERIAL() LOCAL iter LOCAL str$, str2$ iter = MEMORY(2)
OPEN "/dev/ttyACM0" FOR DEVICE AS myserial SETSERIAL myserial SPEED B115200 WHILE (1) GETBYTE iter FROM myserial CHUNK 1 SIZE received str$= iter str2$ = str2$ & str$
IF str$ = NL$ THEN BREAK END IF
WEND
IF ( LEFT$( str2$ ,6) = "$GNGGA" ) THEN ' Decode GNGGA$= str2$ 'cmd$ = "./gpsdc '" & GNGGA$ & "'" 'RES$= EXEC$(cmd$) PRINT GNGGA$ 'PRINT RES$
PRINT "------------------------i"
END IF
CLOSE DEVICE myserial FREE iter RETURN TRUE END FUNCTION
BR Alex
|
|
|
Post by rikky on Jul 1, 2021 6:24:27 GMT 1
Looking forward.
|
|
|
Post by rikky on Jul 7, 2021 16:27:04 GMT 1
Having your own server on a boat is vital I discovered. For a navigation program is just for starters. We have ten thousand wires aboard a ship. Monitoring the batteries and switching on and of the navigation lights is only a little part of it. Mandatory in Europe for cargo ships able to sail the Rhine is for example that if you switch on your navigation lights, and one of them is not working, that your corresponding dashboard navigation light is then also not lit. Imagine the amount of wires needed for this to do this. The new method is having 2 SUPER FAT wires plus and min from front to ars, and then have knots on certain points towards whatever it is (lights anker generator ais etc) controlled by a controller. Mastervolt, Victron, etc they all have this. You have to be a millionaire to be able to afford this. A simple knot controller costs several hundreds of Euro's Closed source. Here comes your old Raspi 3 in handy. I told you not to throw them away. Having a BaCon Server means to be able to controll them 100% Apache etc is too difficult. Coming soon. Rik.
|
|
|
Post by rikky on Jul 10, 2021 12:20:17 GMT 1
Got some sort of server. Took me a few days to figure out that CHANGEDIR does not work in a FORK So I still havent the server working for the seachart. Need to figure out little things But something that serves text or html or png and svg or a script is ready (tryout) the thing serves from /srv Sorry it took so long, and sorry it isnt ready for the seachart yet. SERV.bac (42.43 KB)
|
|
|
Post by rikky on Jul 17, 2021 14:25:51 GMT 1
Coming soon. EDIT : published in the BaconServer thread.
|
|
|
Post by rikky on Aug 27, 2022 21:18:23 GMT 1
Well, since there seems to be some renewed interest in Navigation apps I'll attach a slightly improved server with only the seachart. Nothing fancy. No TLS. It works with SignalK. Tested live. But the server crashed too often for no clear reason. So now there is an ALERT sub in the server that saves the NOW every second, and a test if the time changed. If not, the server is restarted. Will test live again in a few weeks. Download and unpack. Run START. connect your browser to the given ip:port. Surf to ip:port/SeaChart/INDEX If SIGNALK is running somewhere, it will show your ship and the other ships on a chart. Else it wil show a demonstration. Press pause to stop the chart from centering around your ship. Now you can drag the chart around, and all the charts you see will be downloaded to : yourfoldername/SEASERVER/srv/SeaChart/sea_tiles/zoom/x/y.png and yourfoldername/SEASERVER/srv/SeaChart/street_tiles/zoom/x/y.png for offline use. Rik SEASERVER.tgz (276.33 KB)
|
|
|
Post by rikky on Nov 26, 2022 15:39:33 GMT 1
SIGNALK takes a lot of work out of your hands, but it is indeed also written in a language that Alexfish doesn't like and I do not speak, and It gives way too much information that you cannot stop, which takes resources from the little Raspi. I can speak with my AIS directly. usb_port$ = "/dev/ttyUSB0" baudrate = 38400
data = MEMORY(1) OPEN data FOR MEMORY AS mem
OPEN usb_port$ FOR DEVICE AS myserial SETSERIAL myserial SPEED baudrate
WHILE TRUE GETBYTE mem FROM myserial CHUNK 1 SIZE received PRINT CHR$(PEEK(mem)); WEND
CLOSE MEMORY mem FREE data CLOSE DEVICE myserial result: !VDM,1,1,,A,13aGsthP00PA9@4M?NnudwvtR<3V,0*5C !AIVDO,1,1,,,1aGFrPP00P@skvM?FLu6gw2P000*32!AIVDM,1,1,,,833lBGPj2d=d<<=duG@9s?`06@0,0*9 !AIVDM,1,1,,B,33uePP00PmITM0eN4?vv20Rv0*6F !AIVDM,1,1,,A,13`n6@P0P@sM?@44?vvBR,00B !AIVDM,1,1,,B,133gIPP00@qOj;5eNwpRW,0*7 !AIVDM,1,1,,B,133ha:PP00P@n6tM?23dcgwp2W3h,0*31 !AIVDM,1,1,,A,133rWmPP00PA4JLM?1900?vv25h`,0*36 !AIVDM,1,1,,B,13:0HmPP00PA4wnM?<9H5gvv2HBg,0*06 !AIVDM,1,1,,A341duPP17PAIgBMlo1gw028Bu,0*3!AIVDO,1,,1GFrPP00P@sM?F6gwp2P00,0*32 !AIVDM,1,1,,B,1341>R30000A:bPM?odup2:, !AIM,1,A3o9ugP00P@wVhMf4?w02@C6,0*22 !AIVDM,1,1,,130PPP00PACb<M@w>?w0C>,0*7E !AIM,1,,A,13aLk9PP00P5RMmK>gwp2pC@,0*19 !AIVDM,1,1,,B,133f7mPP?<tSF0l4Q@>4?wv0`A,0*22 !AIVDM,1,1,,B,401uE1vJu>P0A;PM@1a02D4m0*01 !AIVDM,1,1,,13;sPP00PA<W`M@1jP0?w2h`,0*7D !AIVDM,1,,B,13q5K60P00P@s`LM?Ewcw2,0*,0*7!AIVDO,1,,1GFr0P@vM?FLu6wwp2P00,022 !AIDM,,,33w;?PP0CPA9=VMoD2H0*4B,1B,13HTeAPP00PAM>4?w228Cp,8 !AIVM,,A,`lLO0P00PA6QTM>JcN4?2HD3,0*38 !APP00P@skvMFLu7Owp2P0,0*1B !AIVD,1,1,,B,333dFV50000A<@2M?kJLP5160Db:,0*09 ^C
All ascii, nothing weird. Easy, I guess. Rik.
|
|
|
Post by alexfish on Nov 26, 2022 23:56:23 GMT 1
|
|