Giter Club home page Giter Club logo

Comments (16)

ykasidit avatar ykasidit commented on July 17, 2024 1

Great to hear that you got a solution via gpsd! Although I'm not sure if it would be helpful in your case, but just wanted to mention that ecodroidgps has a tcp server mode where you can let multiple clients connect concurrently to read the nmea - you can enable this by either changing the config file or the code "tcp_server": "0", to be "tcp_server": "1", in line 38 of https://github.com/ykasidit/ecodroidgps/blob/master/ecodroidgps_server.py (and stop the server, delete the "/config/config.ini" file if exists) then start the server and you can connect to tcp port 8888 on the host (implemented in file https://github.com/ykasidit/ecodroidgps/blob/master/edg_socket_server.py) to get the nmea concurrently via multiple tcp socket (or socat) clients. About using gpsd that's a great idea thanks! I'm still not sure if it will be able to relay all the non-nmea binary UBX or NTRIP protocol payloads (for RTK mode) to/from the device or not (and never tested yet haha so will keep as is for now).

from ecodroidgps.

ser avatar ser commented on July 17, 2024

OK, I've just realised that it's possible to run a pseudo serial port forwarding data from gpsd via gpspipe - https://gpsd.io/gpspipe.html - so it should make a trick to share a GPS to many destinations including ecodroidgps.

But anyway it would be I think cool if ecodroidgps utilises gpsd instead of reading the sensor directly itself.

from ecodroidgps.

ser avatar ser commented on July 17, 2024

Thanks for the hints, I will study carefully your software on days, I have not noticed your socket server indeed. The most amazing is the fact you did exactly what I planned to do :) My use case is I am preparing a motorcycle computer which has access to internal bike computer and GPS in the same time, where I can relate for example engine RPM to precise location given by F9P sensor with large antennae attached and also fed my Andorid phone with more precise location than its internal sensor.

from ecodroidgps.

ser avatar ser commented on July 17, 2024

It's a pipe which serves data from gpsd to ecodroidgps, if somebody will be interested

[Unit]
Description=GPSD pipe for ecodroidgps
After=network.target
After=bluetooth.service
After=gpsd.service

[Service]
Type=simple
ExecStart=socat exec:"'gpspipe --nmea'" pty,rawer,link=/tmp/ecodroidgps0
Restart=always
RestartSec=10
User=pi

[Install]
WantedBy=multi-user.target

from ecodroidgps.

ser avatar ser commented on July 17, 2024

@ykasidit could you please tell me where this name.txt comes from and how it should look like?

NAME=`cat /config/name.txt || echo 'EcoDroidGPS Bluetooth GPS'`

from ecodroidgps.

ser avatar ser commented on July 17, 2024

OK, I realised by trying and testing I need to set in config ble=1.

I can see that error:

python3: can't open file '/home/pi/bluez-gatt-server/bluez-gatt-server.py': [Errno 2] No such file or directory

Does it mean that some other repos than ecodroidgps and bluez-compassion are required?

And later I am continuously getting this error:

('WARNING: las_gen_func exception:', ['Traceback (most recent call last):\n', '  File "/home/pi/ecodroidgps/edg_gps_parser.py", line 203, in gen_ble_location_and_speed_chrc_bytes\n    ret = func(flag_bit_list, logger_state_dict)\n', '  File "/home/pi/ecodroidgps/edg_gps_parser.py", line 281, in gen_inst_speed\n    ret = np.getbuffer(np.uint16(meters_per_second))\n', '  File "/usr/lib/python3/dist-packages/numpy/__init__.py", line 214, in __getattr__\n    raise AttributeError("module {!r} has no attribute "\n', "AttributeError: module 'numpy' has no attribute 'getbuffer'\n"])
('WARNING: las_gen_func exception:', ['Traceback (most recent call last):\n', '  File "/home/pi/ecodroidgps/edg_gps_parser.py", line 203, in gen_ble_location_and_speed_chrc_bytes\n    ret = func(flag_bit_list, logger_state_dict)\n', '  File "/home/pi/ecodroidgps/edg_gps_parser.py", line 300, in gen_position_status_and_location\n    if fix_type >= 2:\n', "TypeError: '>=' not supported between instances of 'str' and 'int'\n"])
('WARNING: las_gen_func exception:', ['Traceback (most recent call last):\n', '  File "/home/pi/ecodroidgps/edg_gps_parser.py", line 203, in gen_ble_location_and_speed_chrc_bytes\n    ret = func(flag_bit_list, logger_state_dict)\n', '  File "/home/pi/ecodroidgps/edg_gps_parser.py", line 250, in gen_elevation\n    ret = np.getbuffer(np.getbuffer(\n', '  File "/usr/lib/python3/dist-packages/numpy/__init__.py", line 214, in __getattr__\n    raise AttributeError("module {!r} has no attribute "\n', "AttributeError: module 'numpy' has no attribute 'getbuffer'\n"])
can't create return buffer
('chrc_bytes none:', None)

I am using current version of RasperrypiOS/bullseye

from ecodroidgps.

ykasidit avatar ykasidit commented on July 17, 2024

from ecodroidgps.

ykasidit avatar ykasidit commented on July 17, 2024

from ecodroidgps.

ser avatar ser commented on July 17, 2024

Hi! Thanks for another hints.

https://github.com/ykasidit/bluez-gatt-server uses python2 which is not available at newer operating system versions :(

I will have a look today if my programming skills are enough to propose patches :)

from ecodroidgps.

ser avatar ser commented on July 17, 2024

OK, i made a pull request for bluez-gatt-server fixing compatibility with python3 in files used by ecodroidgps.

But I don't not fully understand how to replace getbuf with memoryview - maybe you could have a quick look into that? it should be a minor issue for you as it appears in three lines only and you understand your own code for sure :) 👍🏿 :)

from ecodroidgps.

ser avatar ser commented on July 17, 2024

Hi mate! Are you making any progress? If not - could you please say if your intention is to continue this project or I should rather treat it as abandoned and seek other solutions?

from ecodroidgps.

ykasidit avatar ykasidit commented on July 17, 2024

from ecodroidgps.

ser avatar ser commented on July 17, 2024

Hi! Please do not understand me wrong, it's a free opensource project and I realise that all of us are doing it for fun - so no pressure. I was just curious if you still planning to work on it. If yes - fantastic as it's the best one I found. My main interest is a bluetooth service to mock location on Android. I'm working meanwhile on using influxdb to store geo-temporal data available from all sensors on my motorbike, but it's completely independent from ecodroidgps. It also will be GPLed when I have something useful to share.

from ecodroidgps.

ykasidit avatar ykasidit commented on July 17, 2024

from ecodroidgps.

ser avatar ser commented on July 17, 2024

OMG it works!

I was absolutely sure I need BLE to have it running!!!!!!!!!!!!!!!!!!!!!! I have not even tried with ble=0 before.

I can confirm it works with unselected "ecodroidgps broadcast device mode" in your Bluetooth GNSS app with this /config/config.ini:

[main]
spp = 1
ble = 0
gap = 0
tcp_server = 0
gpx = 0
nmea = 0
baud_rate = 115200
pyserial_read_timeout = 1.0
max_readline_size = 4096
max_read_buff_size = 20480

It seems that for my purposes everything is working as it should now. I am shocked and really grateful for your help :)

from ecodroidgps.

ser avatar ser commented on July 17, 2024

If you plan to fix the other features, please remember that GPSD is doing 90% of your job already and provides very stable API. Please use the newest version of it as comparing to package available in Debian it fixed many bugs.

from ecodroidgps.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.