|
Post by rikky on Feb 22, 2021 16:51:34 GMT 1
You know what? I'm not even surprised anymore. Whenever the 0.01% of the shareholders of everything gets hold of something, It declines. You replace your washing machine that lived a 20 years, The new one only goes 8. Same with the raspi, at least the OS sucks. Everything is different and on an other place. Ghhhhh. This thing is designed for children to learn microprocessors. I'm happy I'm not a child. Still not succeeded in getting a static ip.
|
|
|
Post by alexfish on Feb 23, 2021 0:50:53 GMT 1
Hi Rik Plenty of time but to show my own X11 app using gps coords EmdenA picky BR Alex Attachments:
|
|
|
Post by rikky on Feb 23, 2021 17:15:30 GMT 1
Did not suceed with the Noops Buster. Several startupjobs taking ages, and it was a very enerving experience. So I tried OPENPLOTTER. Burned the image started up and ready. It is a buster with OpenCpn and a wifiacces point and a lot of things. But it starts up very rapidly. Next stop is finding the AIS port.
|
|
|
Post by alexfish on Feb 23, 2021 18:12:39 GMT 1
Hi Rik
making headway , good news
At present still muching around , thought would test the gps against gpsfake
these are the results part of printout using
gpsfake -p -i gpsdata.txt and the results of
./gps2 '$GPGGA,081850,3702.2023,N,03522.4668,E,1,07,1.2,62.2,M,29.7,M,,*77'
$GPGGA,081850,3702.2023,N,03522.4668,E,1,07,1.2,62.2,M,29.7,M,,*77 {"class":"TPV","device":"/dev/pts/4","mode":3,"time":"2006-09-23T08:18:50.000Z","ept":0.005,"lat":37.036705000,"lon":35.374446667,"alt":62.200,"track":0.0000,"speed":0.000}
RESULTS Talker ID: GP Time Stamp: 0000-00-00T08:18:50.000Z Latitude: 37.036705 Longitude: 35.374446 Altitude: 62.200 Track: INVALID Speed: INVALID
BR Alex
so looking further at the decimal places & print format
PS : Are the windows any better
|
|
|
Post by rikky on Feb 24, 2021 9:05:30 GMT 1
Got it connected on /dev/ttyUSB0 baudrate 38400 So now get some charts. Incredibly how quick this Buster goes. I must have done something realy wrong in my previous attempts. Unfortunately, and to my astonishment BaCon is not pre installed. Well, I'll leave it that way. Let's not meddle with this OS too much. BaCon executables compiled on the RPi3 seems to work, so I have this: ./gps2 '$GPRMC,023044,A,3907.3840,N,12102.4692,W,0.0,156.1,131102,15.3,E,A*37' Gives me: Talker ID: GP Time Stamp: 2002-11-13T02:30:44.000Z Latitude: 39.123066 Longitude: -121.041153 Altitude: INVALID Track: 156.100
I have no idea how to connect my gpsd to your gps2 however. What windows? Rik.
|
|
|
Post by alexfish on Mar 5, 2021 1:38:53 GMT 1
as regards Serial port read I have not implimented on pi4 till now Please refer to basic-converter.proboards.com/thread/175/serial-port-accessno need to Install the lib , use the .h and .c files as below as test here using gpsd test suit . not good at getting all results since access will block on a read , it is noted the files , but there is a time out funtion which should resolve this issue [b]cssl_settimeout[/b] but it does work, I think says he. bit from the terminal pi@raspberrypi:~/Downloads/libcssl-0.9.2 $ ./test2 $GPGGA,081850,3702.2023,N,03522.4668,E,1,07,1.2,62.2,M,29.7,M,,*77
my new kit as ais & gps + monitor , hopefull to install in next few weeks , dates have changed here due to covid rules will not dwell on that one + brixit and shortage of. the modded code from the thread PRAGMA INCLUDE /home/pi/Downloads/libcssl-0.9.2/cssl.h PRAGMA INCLUDE /home/pi/Downloads/libcssl-0.9.2/cssl.c PRAGMA OPTIONS -D_GNU_SOURCE OPTION PARSE FALSE DECLARE serial TYPE cssl_t * DECLARE finished
'https://basic-converter.proboards.com/thread/175/serial-port-access
' Callback function SUB callback(int id, unsigned char buf[], int length) ' NOT realy Needed FOR i = 0 TO length-1 PRINT CHR$(buf[i]); NEXT END SUB
cssl_start() ' set to device here using demo on "/dev/pts/2" serial= cssl_open("/dev/pts/2",(void*)callback,0,4800,8,0,1)
IF serial = 0 THEN
LOCAL msg$ TYPE STRING msg$ = cssl_geterrormsg() PRINT "failed :", msg$ END -1
END IF
LOCAL buffer[256] TYPE unsigned char LOCAL txt$ TYPE STRING WHILE NOT(finished) memset(buffer,'\0' , 256) cssl_getdata(serial,buffer,255) IF buffer[0] >0 THEN txt$= txt$ & buffer PRINT txt$ END IF SLEEP 1 WEND
PRINT NL$, "^D - we exit", NL$
cssl_close(serial) cssl_stop() BR Alex
|
|
|
Post by alexfish on Mar 5, 2021 2:04:33 GMT 1
|
|
|
Post by alexfish on Mar 5, 2021 4:41:06 GMT 1
|
|
|
Post by rikky on Mar 5, 2021 23:38:57 GMT 1
maybe this will also work ' /dev/pts/2",(void*)callback,0,4800,8,0,1)
' Open the serial port OPEN "/dev/ttyUSB0" FOR SERIAL AS myserial
' Set speed - B0, B50, B75, B110, B134, B150, B200, B300, B600, B1200, B1800, B2400, B4800, B9600, B19200, B38400, B57600, B115200, B230400 SETSERIAL myserial SPEED B4800
Set 8N1 - 8-bit characters... SETSERIAL myserial CMODE ~CSIZE SETSERIAL myserial CMODE CS8
' ...no parity... SETSERIAL myserial CMODE ~PARENB
' ...and 1 stop bit SETSERIAL myserial CMODE ~CSTOPB
I think though that if you query your AIS/GPS then other applications can not query at the same time(?) As I have now understood, they have solved this in OpenPlotter with a server that polls the info and then gives it for all applications to use. It's called: Signal K(But I'm not so far yet, still using /dev/ttyUSB0)
|
|
|
Post by alexfish on Mar 6, 2021 2:33:34 GMT 1
have not managed to get anything from the serial device yet, so looking further
as a quicky
This works
from the socat pi@raspberrypi:~ $ socat -d -d pty,raw,echo=0 pty,raw,echo=0 2021/03/06 00:50:30 socat[28620] N PTY is /dev/pts/3 2021/03/06 00:50:30 socat[28620] N PTY is /dev/pts/4 2021/03/06 00:50:30 socat[28620] N starting data transfer loop with FDs [5,5] and [7,7]
and the bacon code
OPEN "/dev/pts/3" FOR READING AS myfile WHILE 1 DO READLN txt$ FROM myfile IF LEN(txt$) THEN PRINT txt$ END IF WEND CLOSE FILE myfile
from the third terminal
pi@raspberrypi:~ $ echo "Test" > /dev/pts/4 pi@raspberrypi:~ $ echo '$GPGGA,081850,3702.2023,N,03522.4668,E,1,07,1.2,62.2,M,29.7,M,,*77' > /dev/pts/4
and from 2nd bacon terminal
pi@raspberrypi:~/bacon $ ./serial Test $GPGGA,081850,3702.2023,N,03522.4668,E,1,07,1.2,62.2,M,29.7,M,,*77
at end of day, will probably need the timeout and callback functions in the mentioned lib
as regards K signal , as soon as I see J then I want to run a mile
as Vovchik once said
'Why use a Howitzer when a peashooter will do'
+ I am looking at the exchange format 'JSON' that can be done with gpsd
as a side note and in short I broke the PI4 sd card, and had to get a new one
BR Alex
Forgot to mention If have permission problems on tty's serial like /dev/ttyUSB0 with bacon (OPEN "/dev/pts/3" FOR READING AS myfile) try adding the bit to dialout
If wanting to access different devices at the same time look at the BaCon Web site and look for 'INCLUDE: POSIX Threads' + examples more on that one later.
|
|
|
Post by alexfish on Mar 6, 2021 5:26:49 GMT 1
Agh Well
need to dig deeper
getting garbage from the real I am with bacon open file as normal on ttyUSB0
here is a sample from my ais gps
��5�!%������$5�!%������!����%1�%�!�%�!��!�������s1]!��!%�%�1����5�1%�1�% 5�!%����%�5�!%��1!1���!�֡!!���1�!�%11!ġ!!�!���!�!1��!!!����!��!������1!!��!��%1!1%� ��1�%%�a%�5�!%���%��a$5�!%��1!1�h�!�֡!���1�!�%1�!ġ!!�!���!��1��!�!!����!��!�������s1!!��!%�5!%1%� �%��%�%�5�!%��%!%��$5�11!!%�F���!�֡!��1�!�%1��ġ!!�!���!�!1��!��!����!��!����!��1!!��!%�%!�1%� 11���%��%11!���%��$5%�1!!�����!֡!����1�!�%1�!ġ!ɡ!���!�!1����!!����!��!������1!!�%11!�!��� �1�5%�%�5%11!���%��$5%�1!!�����!�֡!����1�ߡ%1�!ġ!!�����!�!1��!�!!����ѡ�!�������s1!!�%11�1%1%� ��5%�1�%�5%11!!%�%��$5%11!������!�֡!!��1�!�%ѡ!ġ!!�!���!�!1��!�!!����!��
in there is AIS noted from '!' also GPS noted from '$'
now going to download the necessary, as mentioned working with new install , for what it is worth , gpsd does not recognize the device well up to now,
if can make udev rule from the lsusb -v command , it may be possible that the gpsd will connect , ie configure in gpsd.socket
part of its rules
SUBSYSTEM!="tty", GOTO="gpsd_rules_end"
# Prolific Technology, Inc. PL2303 Serial Port [linux module: pl2303] # rule disabled in Debian as it matches too many other devices #ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", SYMLINK+="gps%n", TAG+="systemd", ENV{SYSTEMD_WANTS}="gpsdctl@%k.service"
# ATEN International Co., Ltd UC-232A Serial Port [linux module: pl2303] ATTRS{idVendor}=="0557", ATTRS{idProduct}=="2008", SYMLINK+="gps%n", TAG+="systemd", ENV{SYSTEMD_WANTS}="gpsdctl@%k.service" # PS-360 OEM (GPS sold with MS Street and Trips 2005) [linux module: pl2303] ATTRS{idVendor}=="067b", ATTRS{idProduct}=="aaa0", SYMLINK+="gps%n", TAG+="systemd", ENV{SYSTEMD_WANTS}="gpsdctl@%k.service"
# FTDI 8U232AM / FT232 [linux module: ftdi_sio] # rule disabled in Debian as it matches too many other devices #ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", SYMLINK+="gps%n", TAG+="systemd", ENV{SYSTEMD_WANTS}="gpsdctl@%k.service"
# Cypress M8/CY7C64013 (Delorme uses these) [linux module: cypress_m8] ATTRS{idVendor}=="1163", ATTRS{idProduct}=="0100", SYMLINK+="gps%n", TAG+="systemd", ENV{SYSTEMD_WANTS}="gpsdctl@%k.service" # Cypress M8/CY7C64013 (DeLorme LT-40) ATTRS{idVendor}=="1163", ATTRS{idProduct}=="0200", SYMLINK+="gps%n", TAG+="systemd", ENV{SYSTEMD_WANTS}="gpsdctl@%k.service" # Garmin International GPSmap, various models (tested with Garmin GPS 18 USB) [linux module: garmin_gps] ATTRS{idVendor}=="091e", ATTRS{idProduct}=="0003", SYMLINK+="gps%n", TAG+="systemd", ENV{SYSTEMD_WANTS}="gpsdctl@%k.service" # Cygnal Integrated Products, Inc. CP210x Composite Device (Used by Holux m241 and Wintec grays2 wbt-201) [linux module: cp210x] ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", SYMLINK+="gps%n", TAG+="systemd", ENV{SYSTEMD_WANTS}="gpsdctl@%k.service" # Cygnal Integrated Products, Inc. [linux module: cp210x] ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea71", SYMLINK+="gps%n", TAG+="systemd", ENV{SYSTEMD_WANTS}="gpsdctl@%k.service" # u-blox AG, u-blox 5 (tested with Navilock NL-402U) [linux module: cdc_acm] ATTRS{idVendor}=="1546", ATTRS{idProduct}=="01a5", SYMLINK+="gps%n", TAG+="systemd", ENV{SYSTEMD_WANTS}="gpsdctl@%k.service" # u-blox AG, u-blox 6 (tested with GNSS Evaluation Kit TCXO) [linux module: cdc_acm] ATTRS{idVendor}=="1546", ATTRS{idProduct}=="01a6", SYMLINK+="gps%n", TAG+="systemd", ENV{SYSTEMD_WANTS}="gpsdctl@%k.service" # u-blox AG, u-blox 7 [linux module: cdc_acm] ATTRS{idVendor}=="1546", ATTRS{idProduct}=="01a7", SYMLINK+="gps%n", TAG+="systemd", ENV{SYSTEMD_WANTS}="gpsdctl@%k.service" # u-blox AG, u-blox 8 (tested with GNSS Evaluation Kit EKV-M8N) [linux module: cdc_acm] ATTRS{idVendor}=="1546", ATTRS{idProduct}=="01a8", SYMLINK+="gps%n", TAG+="systemd", ENV{SYSTEMD_WANTS}="gpsdctl@%k.service" # MediaTek (tested with HOLUX M-1200E) [linux module: cdc_acm] ATTRS{idVendor}=="0e8d", ATTRS{idProduct}=="3329", SYMLINK+="gps%n", TAG+="systemd", ENV{SYSTEMD_WANTS}="gpsdctl@%k.service" # Telit wireless solutions (tested with HE910G) [linux module: cdc_acm] ATTRS{interface}=="Telit Wireless Module Port", ATTRS{bInterfaceNumber}=="06", SYMLINK+="gps%n", TAG+="systemd", ENV{SYSTEMD_WANTS}="gpsdctl@%k.service"
ACTION=="remove", TAG+="systemd", ENV{SYSTEMD_WANTS}="gpsdctl@%k.service"
of note , looking at the ID's of my device
idVendor 0x1a86 idProduct 0x7523
BR Alex
|
|
|
Post by rikky on Mar 6, 2021 6:48:59 GMT 1
I think that means that you have to change your baudrate.
|
|
|
Post by alexfish on Mar 6, 2021 9:55:15 GMT 1
Hi Rik,
had just sorted that one, and ready to post results, also updated the serial driver
not posting data but for my device
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
'https://basic-converter.proboards.com/thread/175/serial-port-access
' Callback function SUB callback(int id, unsigned char buf[], int length) FOR i = 0 TO length-1 PRINT CHR$(buf[i]); NEXT END SUB
cssl_start() ' set to device here using demo on "/dev/pts/2" 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
LOCAL buffer[256] TYPE unsigned char LOCAL txt$ TYPE STRING WHILE NOT(finished)
SLEEP 1 WEND
PRINT NL$, "^D - we exit", NL$
cssl_close(serial) cssl_stop()
BR Alex
Note Here it works through the callback function
|
|
|
Post by alexfish on Mar 6, 2021 12:58:41 GMT 1
Hi All
as part of this thread I will be using maps
For SeaMaps go to the openseamp the free nautical charst . go to downloads and select the area
click on the downloads select format : mbtiles . note the size IE ensure esp on rpi there is enough disk space for the download conversion . if 1.5gb = 1.5 *3 , can recover space by deleting the mbtiles after conversion
for conversion use mb-util its a python script . and need to convert to png
example
cd Downloads git clone https://github.com/mapbox/mbutil.git cd to the mbutil
command
mb-util --image_format png /pathto/*.mbtiles seamaps in my case
mb-util --image_format png /home/pi/Downloads/OSM-OpenCPN2-NorthSea-20201106-2207.mbtiles seamaps
in there will be there will be the png files + a json file . leave as is.
if not want seamaps , will be posting details of the bacon tile server for openstreetmap later
BR Alex
|
|
|
Post by alexfish on Mar 6, 2021 20:50:10 GMT 1
have tested the small gps lib mentioned in first post with the data Results = Bang on The Nail
the gps bits to get position Example
'change the paths to libcssl 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)
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 PRINT NMEA$ END IF
NMEA$="" END IF NEXT
END SUB
cssl_start()
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
LOCAL buffer[256] TYPE unsigned char LOCAL txt$ TYPE STRING WHILE NOT(finished)
SLEEP 1 WEND
PRINT NL$, "^D - we exit", NL$
cssl_close(serial) cssl_stop()
BR Alex
|
|