Giter Club home page Giter Club logo

hishizuka / pizero_bikecomputer Goto Github PK

View Code? Open in Web Editor NEW
709.0 35.0 61.0 1.26 MB

An open source bike computer based on Raspberry Pi Zero (W, WH, 2W) with GPS and ANT+. Including offline map and navigation.

Home Page: https://qiita.com/hishi/items/46619b271daaa9ad41b3

License: GNU General Public License v3.0

Python 95.72% Shell 0.18% C++ 3.74% Cython 0.32% Dockerfile 0.03%
raspberry-pi power-meter cycling python gps fit tcx sensor antplus pyqt5

pizero_bikecomputer's People

Contributors

cclauss avatar hishizuka avatar ptosiek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pizero_bikecomputer's Issues

Google direction API doesn't work

Hi, i worked with your application, but i cant seem to get the Google direction api working

First of all
I got the API key from google direction api.
I putted the key into the google direction section in settings.conf but this doesn't seem to work it keeps disappearing, and also i don't get the G option in maps to search for any routes.

Demo mode speed

Hi is it possible to make the demo speed more slower. Currently the bike is going way to fast to test certain things

real time W'bal integration as info displayed

It's more of an idea than feature request ( I'll probably never build a bike computer even given a very detailled how to like you're doing here :-) ).

I, nevertheless, appreciate your great work.

I'm using using Goldencheetah to keep track of my bike rides and I thought it would be great for some bike tourers to have that W' bal info ( the red curve on the screenshot below ) directly available on the screen, in ( almost, recalculated every few minutes, kilometers... ) real time to, for example not overwork themselves during sorties. I didn't real dig on the what that would involve but at first glance, it seems you're already packing all what's needed on your board.

Again it's just an idea...and congratulation ๐Ÿ‘ on what you did.

W'bal red graph

Error; coroutine awaited (qasync)

Thank you very much for the wonderful project.
However, I have a problem starting the application and need help.
After following the guide to install this, and running it, I run into this error;

########## INITIALIZE START ##########
Raspberry Pi Zero W Rev 1.1(BCM2835), serial:0xd943328a
Initialize modules:
config import : 4.042 sec
config init : 0.171 sec
display import: 0.022 sec
display init : 0.000 sec
import gui : 2.463 sec
import logger : 0.047 sec
total : 6.745 sec
########## INITIALIZE END ##########
Traceback (most recent call last):
File "/home/pi/pizero_bikecomputer/pizero_bikecomputer.py", line 56, in
main()
File "/home/pi/pizero_bikecomputer/pizero_bikecomputer.py", line 52, in main
gui_pyqt.GUI_PyQt(config)
File "/home/pi/pizero_bikecomputer/modules/gui_pyqt.py", line 149, in init
self.init_window()
File "/home/pi/pizero_bikecomputer/modules/gui_pyqt.py", line 155, in init_window
self.config.init_loop(call_from_gui=True)
File "/home/pi/pizero_bikecomputer/modules/config.py", line 766, in init_loop
self.start_coroutine()
File "/home/pi/pizero_bikecomputer/modules/config.py", line 771, in start_coroutine
self.logger.start_coroutine()
File "/home/pi/pizero_bikecomputer/modules/logger_core.py", line 87, in start_coroutine
asyncio.create_task(self.sql_worker())
File "/usr/lib/python3.9/asyncio/tasks.py", line 360, in create_task
loop = events.get_running_loop()
RuntimeError
:
no running event loop
sys:1: RuntimeWarning: coroutine 'LoggerCore.sql_worker' was never awaited

I'm running Pi OS 32 Bit (Bullseye Full) on Pi0 W with pi user

GPS cutoff values

I'm reworking the gps sensors (ot much knowledgeable in it, would have quite some questions):
I don't really get this part (and there's a bug)

        lat = (
            lon
        ) = alt = spd = heading = hdop = mode = timestamp = self.config.G_GPS_NULLVALUE
        .....
        if "hdop" in message:
            hdop = float(message["hdop"])
            if hdop < 10:
                mode = 3
            elif hdop < 20:
                mode = 2
            else:
                mode = 1
        if hdop >= 20.0:
            return
  1. It works because hdop is always in message, else you'd have something lile None > 20.0 in that last test, so it should be moved or removed (cf 2.)
  2. I don't even get why there would be an early return here, the position should still be sent to the update ? And it should just be marked as invalid in get_GPS_basic_values... But why do we have there different cutoff values:?
valid_cutoff_dof = [99.0, 99.0, 99.0] 

multiple networks

I am trying to read from both ANT+ devices and non-ANT+ (PUBLIC) devices. (I can successfully read from both individually using 2 separate programs.) I added the PUBLIC and ANTPLUS network keys as network 0x00 and 0x01. I created 2 channels using each of the networks. However I can only successfully read from network 0x00 (PUBLIC). How can I also read from network 0x01 (ANTPLUS)?

Here is my test code

`from ant.easy.node import Node
from ant.easy.channel import Channel
from ant.base.message import Message

import logging
import struct
import threading
import sys

ANTPLUS_NETWORK_KEY = [0xB9, 0xA5, 0x21, 0xFB, 0xBD, 0x72, 0xC3, 0x45]
PUBLIC_NETWORK_KEY = [0xE8, 0xE4, 0x21, 0x3B, 0x55, 0x7A, 0x67, 0xC1]

def on_data(data):
hx = list(map(hex, data.tolist()))
if len(data) > 8:
deviceNumberLSB = data[9]
deviceNumberMSB = data[10]
deviceNumber = "{}".format(deviceNumberLSB + (deviceNumberMSB << 8))
deviceType = "{}".format(data[11])
else:
deviceNumber = 0
deviceType = 0
print("DeviceNr: {} DeviceType: {} Data: {}".format(deviceNumber, deviceType, hx))
sys.stdout.flush()

def main():
logging.basicConfig(filename="example.log", level=logging.DEBUG)

node = Node()
node.set_network_key(0x00, PUBLIC_NETWORK_KEY)
node.set_network_key(0x01, ANTPLUS_NETWORK_KEY)

# PUBLIC sensor
channel0 = node.new_channel(Channel.Type.BIDIRECTIONAL_RECEIVE, 0x00, 0x00) # network 0x00 PUBLIC

channel0.on_broadcast_data = on_data
channel0.on_burst_data = on_data
channel0.on_acknowledge = on_data

channel0.set_id(0, 0, 0) # wildcards
channel0.enable_extended_messages(1)
channel0.set_search_timeout(12)
channel0.set_period(3895)
channel0.set_rf_freq(67)

ANTPLUS heartrate

channel1 = node.new_channel(Channel.Type.BIDIRECTIONAL_RECEIVE, 0x00, 0x01) # network 0x01 ANTPLUS

channel1.on_broadcast_data = on_data
channel1.on_burst_data = on_data
channel1.on_acknowledge = on_data

channel1.set_id(0, 0, 0) # wildcards
channel1.enable_extended_messages(1)
channel1.set_search_timeout(0xFF)
channel1.set_period(8070)
channel1.set_rf_freq(57)

try:
    channel1.open()
    channel0.open()
    node.start()
finally:
    channel1.close()
    channel0.close()
    node.stop()

if name == "main":
main()

`

The output is only from the 0x00 PUBLIC network. There is no output from the ANT+ heart rate sensor.
DeviceNr: 18192 DeviceType: 112 Data: ['0xe4', '0xf3', '0xd9', '0x2', '0xf3', '0x0', '0x6b', '0x21', '0x80', '0x10', '0x47', '0x70', '0x5'] DeviceNr: 18192 DeviceType: 112 Data: ['0xe4', '0xf4', '0xdb', '0x2', '0xf4', '0x0', '0x6b', '0x21', '0x80', '0x10', '0x47', '0x70', '0x5'] ...

Need some help with I2C sensor configuration

Hi, hishi, hope you are doing well. I'd like to firstly appreciate your work, but something going wrong with my I2C sensor - BMP280. For some reason I couldn't buy the product like Adafruit and SparkFun Qwiic SHIM for Raspberry Pi (https://www.sparkfun.com/products/15794), so I use GY-BMP280-3.3 as substitution. While I connecting the VCC, GND, SCL and SDA pins with Raspberry Pi (and CSB, SDO are left vacant), bikecomputer seems not have receive the data form BMP280, and the demo mode shows:

Loading original modules...
config : 2.914984 sec
GPS : True
GPS_ADAFRUIT_UART : False
GPS_I2C : False
ANT : False
RPi GPIO : True
I2C : True
...
detected I2c sensors:
PiTFT 2.8(r) : True

Is my connection wrong or the configuration is not completed? Looking forward to your solution, thanks again.

No issue, sorry just a question.

I really like your project! it is exactly what I am looking for, I do have a couple of questions/ suggestions. Is there a way to stream live video and the data from GPS to a mapping software. My son races and it would be cool to watch him race live through a first person camera and see his location, speed, altitude live as well.

Simple map

in layout.Yaml i see simple_map, but I want to put the map on one of the other screens, for example, in the MAIN. I don't know how to do it. I tried it like this, but it didn't work:
image
Do you have any idea how I could get the map in there? Before this, you sent me the config file, but I couldn't find anything called simple_map only in layout; it was called like that.

Change layout (question)

Hi, i wanted to change the gui (layout) from the first screen with the power graph, in which file can i find this?

Download custom tiles

Hoi, i wanted to know if it was possible to predownload some tiles for example a part of a city for offline use.

Are maybe some function in the code i could use to make that possible?

Thank you

ant usb not working on RPiZeroW or RPiZero2W

Hi, I'm trying to run openant or bikecomputer on a RPi. I can successfully run bikecomputer on a mac where it finds an Ant+ heartrate sensor and displays the HR.

On a RPi 3B v1.2 I can successfully run the openant examples to see the HR using an ANT+ usb dongle.

But if I move the sdcard and usb to a RPiZero2W then the usb is never found. Dmesg shows

[   44.984439] usb 1-1: new full-speed USB device number 2 using dwc2
[   45.204440] usb 1-1: device descriptor read/64, error -71
[   45.544545] usb 1-1: device descriptor read/64, error -71
[   45.884446] usb 1-1: new full-speed USB device number 3 using dwc2
[   46.104446] usb 1-1: device descriptor read/64, error -71
[   46.444438] usb 1-1: device descriptor read/64, error -71
[   46.564514] usb usb1-port1: attempt power cycle

Supposedly this error has to do with inadequate power. However the power sources should be adequate (either mac powerbook (usbC port) or my powerbook charger (usbC port)) for all testing of RPi 3B, ZeroW and Zero2W. There is nothing attached to the RPi computers other than the ant usb dongle. I have 2 dongles (marked "Garmin" or "ANT+") and both work fine on my mac.

If I move the sdcard to a new 2nd RpiZero2W then it fails with the same issue.

If I move the sdcard to a RPiZeroW then the usb is recognized (dmesg, lsusb, /dev/ttyUSB0), but the openant examples fail e.g.

python3 scan.py 
Driver available: [<class 'ant.base.driver.USB2Driver'>, <class 'ant.base.driver.USB3Driver'>]
 - Using: <class 'ant.base.driver.USB3Driver'>
Traceback (most recent call last):
  File "scan.py", line 78, in <module>
    main()
  File "scan.py", line 55, in main
    node = Node()
  File "/home/pi/Documents/ant/openant/ant/easy/node.py", line 55, in __init__
    self.ant = Ant()
  File "/home/pi/Documents/ant/openant/ant/base/ant.py", line 60, in __init__
    self._driver.open()
  File "/home/pi/Documents/ant/openant/ant/base/driver.py", line 202, in open
    dev.set_configuration()
  File "/home/pi/.local/lib/python3.7/site-packages/usb/core.py", line 915, in set_configuration
    self._ctx.managed_set_configuration(self, configuration)
  File "/home/pi/.local/lib/python3.7/site-packages/usb/core.py", line 113, in wrapper
    return f(self, *args, **kwargs)
  File "/home/pi/.local/lib/python3.7/site-packages/usb/core.py", line 159, in managed_set_configuration
    self.backend.set_configuration(self.handle, cfg.bConfigurationValue)
  File "/home/pi/.local/lib/python3.7/site-packages/usb/backend/libusb1.py", line 812, in set_configuration
    _check(self.lib.libusb_set_configuration(dev_handle.handle, config_value))
  File "/home/pi/.local/lib/python3.7/site-packages/usb/backend/libusb1.py", line 604, in _check
    raise USBError(_strerror(ret), ret, _libusb_errno[ret])
usb.core.USBError: [Errno None] Other error

How do I get openant running on a RpiZero or RpiZero2?
Thanks

Unable to use --demo with my own .tcx file

Hey hishizuka,
as a complete novice I am trying to recreate your project with Pizero 2 W with a Adafruit Sharp Display.

I am currently demoing the raspberry over XRDP and I am unable to load a .tcx file when starting pizero_bikecomputer.py

The output is as follows:
Loading original modules...
config : 3.376206 sec
GPS : True
GPS_ADAFRUIT_UART : False
GPS_I2C : False
ANT : False
RPi GPIO : True
I2C : True
running build_ext
skipping '/home/pi/.pyxbld/temp.linux-armv7l-3.9/pyrex/modules/logger/cython/logger_fit.cpp' Cython extension (up-to-date)
skipping 'modules.logger.cython.logger_fit' extension (up-to-date)
logger_core : 1.428127 sec
Loading modules... done : 4.820308 sec
Raspberry Pi Zero 2 W Rev 1.0(BCM2835), serial:0xb4431714
logger_core : init...
detected I2c sensors:
PiTFT 2.8(r) : True
GPS/ANT+/I2C/GPIO/integrate/start: ['0.017962', '0.000565', '0.246051', '0.000136', '0.000180', '0.178859']
logger_core : init...
logger_core : loading course...
loading /home/pi/pizero_bikecomputer/course/course.tcx
logger_core : load_course : read tcx(regex): 1.098054 sec
Traceback (most recent call last):
File "/home/pi/pizero_bikecomputer/pizero_bikecomputer.py", line 51, in
main()
File "/home/pi/pizero_bikecomputer/pizero_bikecomputer.py", line 20, in main
logger = modules.logger_core.LoggerCore(config)
File "/home/pi/pizero_bikecomputer/modules/logger_core.py", line 119, in init
self.course.load()
File "/home/pi/pizero_bikecomputer/modules/logger/loader_tcx.py", line 84, in load
self.read_tcx()
File "/home/pi/pizero_bikecomputer/modules/logger/loader_tcx.py", line 180, in read_tcx
self.point_notes = list(np.array(self.point_notes)[not_straight_cond])
IndexError: boolean index did not match indexed array along dimension 0; dimension is 429 but corresponding boolean dimension is 431
^CException ignored in: <module 'threading' from '/usr/lib/python3.9/threading.py'>
Traceback (most recent call last):
File "/usr/lib/python3.9/threading.py", line 1428, in _shutdown
lock.acquire()
KeyboardInterrupt:

Are you able to upload a sample course.tcx to the repository?

Thank you for your great work!

Trailforks integration

Trailforks it's an amazing source for different type of trails, and I wonder if it could be included in your project. Anyway, did you think about making a commercial product out of this? I mean, designing the PCB and the case, and sell it?

Contacting the developer

Hi,

Congratulations on your really cool project!
We are a startup that develops tools for e-bikes and we are very impressed with your work! We would like to get in touch with you to discuss some possible collaboration.

Our contact page is https://shop.eggrider.com/contact

PS: we wrote to you on Strava and we are unable to write you direct messages on Twitter or Github.

Adding GPS to the main screen.

Hey, I've customized the MAIN screen, but I'm not sure how to display the GPS information in a small screen on the bottom left. I'd like to replace the 'work' display with GPS. Do you have any ideas on how I can achieve this.

image

Back button on non touch device

I'm struggling a bit setting the focus on proper widget (Trying to replace the code setting focus_widget/delete_focus).
I did have fixed it but I actually wonder. If I understand properly the logic:

  • If we have touch, no focus is set by default, which ends up being the back button
  • If we don't have touch, the focus tried to be set on first element or back button.

Now we can have the case where touch is broken/user wants to use the physical buttons anyway. (I guess that it's why the delete_focus is made only when not on the Pi). So we need something to focus by default: which ends up being the (graphical) back button in that case.
But, we can always leave the screen by using the physical one so it's a bit redundant. Actually for a 'pure' non touch device the graphical back button is hardly gonna be used.

I think by:

  1. having the back button never focusable.
  2. having always focus set a similar way if touch/no touch device.

This would very much simplify the code around setting the next focus widget . The only con is see is that even on touch device we will have something focused in (as in: a menu item compared to the back button previously) when opening menu

(for 1. we could remove the graphical back button for non-touch devices, but probably better not doing it)

P.S: Prob an error in the documentation:
image
A and E in that case should be Left (<) and Right (>)

frequent timeouts when starting

Using the OTG adapter https://www.adafruit.com/product/2910 and an authentic ANT+ dongle I got Openant to run on a RPiZero2W on Bullseye. The cable adapter https://www.adafruit.com/product/898 works on RpiZeroW but not RpiZero2W.

I want to get stable ANT+ data before trying to run pizero_bikecomputer. However I get frequent AntExceptions and timeouts when running openant examples e.g. heart_rate_monitor.py. I ran heart_rate_monitor 20 times and 5 runs run fail like this. There appear to be 2 issues: a) Setting network key sometimes fails, and b) USBError times out (this error prints at 1Hz like the heartbeat, but no heartbeat is printed).

Sometimes it runs, sometimes not. I get similar errors running other openant examples.
Any suggestions?

pi@raspberrypi:~/Documents/ant $ python3 heart_rate_monitor.py
Driver available: [<class ant.base.driver.SerialDriver>, <class ant.base.driver.USB2Driver>, <class ant.base.driver.USB3Driver>]
Using: <class ant.base.driver.USB3Driver>
<class usb.core.USBError>, (110, Operation timed out)
Heartrate: 82 [BPM]
Heartrate: 82 [BPM]
Heartrate: 82 [BPM]
Heartrate: 81 [BPM]

pi@raspberrypi:~/Documents/ant $ python3 heart_rate_monitor.py
Driver available: [<class ant.base.driver.SerialDriver>, <class ant.base.driver.USB2Driver>, <class ant.base.driver.USB3Driver>]
Using:
<class usb.core.USBError>, (110, Operation timed out)
<class usb.core.USBError>, (110, Operation timed out)
<class usb.core.USBError>, (110, Operation timed out)
<class usb.core.USBError>, (110, Operation timed out)
<class usb.core.USBError>, (110, Operation timed out)
<class usb.core.USBError>, (110, Operation timed out)
<class usb.core.USBError>, (110, Operation timed out)
<class usb.core.USBError>, (110, Operation timed out)
<class usb.core.USBError>, (110, Operation timed out)
<class usb.core.USBError>, (110, Operation timed out)
Traceback (most recent call last):
File "/home/pi/Documents/ant/heart_rate_monitor.py", line 69, in
main()
File "/home/pi/Documents/ant/heart_rate_monitor.py", line 49, in main
node.set_network_key(0x00, NETWORK_KEY)
File "/usr/local/lib/python3.9/dist-packages/ant/easy/node.py", line 84, in set_network_key
return self.wait_for_response(Message.ID.SET_NETWORK_KEY)
File "/usr/local/lib/python3.9/dist-packages/ant/easy/node.py", line 103, in wait_for_response
return wait_for_response(event_id, self._responses, self._responses_cond)
File "/usr/local/lib/python3.9/dist-packages/ant/easy/filter.py", line 98, in wait_for_response
return wait_for_message(match, process, queue, condition)
File "/usr/local/lib/python3.9/dist-packages/ant/easy/filter.py", line 62, in wait_for_message
raise AntException("Timed out while waiting for message")
ant.easy.exception.AntException: Timed out while waiting for message
<class usb.core.USBError>, (110, Operation timed out)
<class usb.core.USBError>, (110, Operation timed out)

MIP_640 direct update

in display_core/update:

    if not self.config.G_IS_RASPI or not self.send_display:
      return

    if direct_update and self.config.G_DISPLAY in ('MIP', 'MIP_Sharp', 'MIP_Sharp_320'):
      self.display.update(buf, direct_update)
    elif self.config.G_DISPLAY in ('MIP', 'MIP_640', 'MIP_Sharp', 'MIP_Sharp_320'):
      self.display.update(buf, direct_update=False)
    elif self.config.G_DISPLAY in ('Papirus', 'DFRobot_RPi_Display'):
      self.display.update(buf)

MIP_640 is handled differently from the rest for direct_update. Is it a bug or is on purpose ?

Wiringpi deprecated

It appears wiringpi can no longer be installed. I don't really know what I'm doing and have just been following the instructions you provided. Is there some sort of workaround to install wiringpi?

Question Regarding Compatibility

Currently there seems to be a shortage of Raspberry Pi Zeros, as a result I was wondering if I could use a Radxa Zero to the same effect. If so, what would be different with hardware & software? If you're not sure, no worries.

Can't seem to get Ride with gps working (Question)

Hi, Sorry for the many questions.

So heres what i did

  1. I created a account on Ride with gps
  2. I made a route on there
  3. I followed your guide and got a auth_token
  4. I filled in the auth_token into here:
    image
  5. I started up the app and went to courses, but it is empty:
    image
    I do have a route in RWGPS:
    image
  6. Also when i go to upload activity i says:
    image
  7. When i do 6 the key also disapeared from the setttings.conf file

I2C GPS

I know you wrote the support as 'experimental' but:
I've just got the Pimoroni breakout module and connected it though I2C (just because it's easier, and also wanted to test that code path)
The pa1010d lib does not return the track, and the "timestamp" field returned is a time object not a datetime.

But it's a lib limitation (cf. https://github.com/pimoroni/pa1010d-python/pull/12/files)

Should we:
1 Fork the lib
2 Reimplement it in this repo
3 Drop direct I2C support and somewhat pass it through GPSD anyway (cf https://ozzmaker.com/accessing-gps-via-i2c-on-a-berrygps-imu/), that suppose a bugger rewrite (mainly the way we detect/use the GPS sensor)

It's somewhat blocking this branch:
https://github.com/Ptosiek/pizero_bikecomputer/tree/gps
unless we decide to solve that later.
(The adafruit uart path is not tested either)

Radar support via LD2450?

So I've been building ESPHome sensors using an LD2450. These are purpose built for detecting human presence, but could something similar be done to use as a rear radar similar to a Garmin Varia?

Theoretically it could be wired via GPIO, or with a ESP mini and a small battery wirelessly. The LD2450 also has Bluetooth built in, but I'm not sure of an interface method with the Pi0, or if this would even be a good sensor.

Start/stop button not working

Hi,

Thanks for the project. I've been playing with it for the last couple days and have started to change a few things/fix what I see.
Are you even open/do you have time for PR ?

First one would be that the start/stop button is broken, getting:
Traceback (most recent call last):
File "/home/antonin/Work/pizero_bikecomputer/modules/pyqt/pyqt_button_box_widget.py", line 112, in gui_start_and_stop_quit
self.config.logger.start_and_stop_manual()
File "/home/antonin/Work/pizero_bikecomputer/modules/logger_core.py", line 292, in start_and_stop_manual
self.config.gui.change_start_stop_button(self.config.G_MANUAL_STATUS)
File "/home/antonin/Work/pizero_bikecomputer/modules/gui_pyqt.py", line 562, in change_start_stop_button
self.button_box_widget.change_start_stop_button(status)
File "/home/antonin/Work/pizero_bikecomputer/modules/pyqt/pyqt_button_box_widget.py", line 115, in change_start_stop_button
icon = QtGui.QIcon(self.config.gui.icon_dir+'img/pause_white.png')
AttributeError: 'GUI_PyQt' object has no attribute 'icon_dir'

on click.

As a side note, I find disconcerting the icons. I would expect them to be switched between the state, eg they represent the state we wants to set, not the one we are in. So next_white.png is displayed when we are in stop/pause state whereas pause_white.png is displayed when we are in start state.

AttributeError: module 'PyQt5.QtGui' has no attribute 'QTextEdit'

Hi Hishi
Great project and I am enjoying trying to get this to work. Diligently working my way through the hardware and software installs and have a timeout issue with ANT+ and some questions about using the waveform 2.4" display

But main issue is trying to get the graphics to work in console mode, keep getting this issue

Traceback (most recent call last):
File "pizero_bikecomputer.py", line 49, in
main()
File "pizero_bikecomputer.py", line 39, in main
gui = gui_pyqt.GUI_PyQt(config)
File "/home/pi/pizero_bikecomputer/modules/gui_pyqt.py", line 108, in init
self.init_window()
File "/home/pi/pizero_bikecomputer/modules/gui_pyqt.py", line 187, in init_window
self.debug_log_viewer_widget = DebugLogViewerWidget(self.stack_widget, "Debug Log Viewer", self.config)
File "/home/pi/pizero_bikecomputer/modules/pyqt/menu/pyqt_menu_widget.py", line 37, in init
self.setup_ui()
File "/home/pi/pizero_bikecomputer/modules/pyqt/menu/pyqt_menu_widget.py", line 65, in setup_ui
self.setup_menu()
File "/home/pi/pizero_bikecomputer/modules/pyqt/menu/pyqt_debug_widget.py", line 32, in setup_menu
self.editor = QtWidgets.QTextEdit() if USE_PYQT6 else QtGui.QTextEdit()
AttributeError: module 'PyQt5.QtGui' has no attribute 'QTextEdit'

Any help will be much appreciated
THAnks
Simon

Compatibility with Raspberry Pi Pico W

Hi there,

can you confirm the project working on a RPi Pico W MCU?
If not, what is required compared to the RPi Zero SBC, that the Pico doesn't offer?

Best & thanks in advance

PA1010D I2C sensor

My PA1010D sensor doesnt seem to work in the pizero app, It keeps staying on a part of Japan?
image

Incorrect course points distance

When using this file (had to zip it)
BB_Loop.tcx.zip

with course_indexing set to true, the resulting distances are incorrect (cf first points in screenshot):
image

So this file contains several time the same course point (at different time). My guess is that this:

                inner_p_check = np.where(
                    (0.0 <= inner_p) & (inner_p <= 1.0), True, False
                )

will find the point 'too late', probably because the first 'original' course point was removed after downsampling.

But maybe it's because the inner_p contains negative value ?
[-1.30880983e-04 -2.54499666e+00 -2.28468095e+00 -2.63298573e+00
-3.35629025e+00 -7.24880940e-01 2.35766962e+00 -4.03876418e+00
-5.17857143e+00 -1.31062866e+01 -2.59921773e+00 -2.27057057e+01...

My thought on the process:
We might want to set the course_points distance before downsampling actually, and if possible when files contains time+distance like this one we would be better reading the distance directly from trackpoint rather than recalculating it manually ?

log filename format

Hi @Ptosiek ,

The log file name is determined by isoformat(), but ":" is a bit unwieldy because it requires an escape character.

We would like to change the format of the time as follows
What do you think?

  • '20231015023506'
  • '2023_10_15_02_35_06'
  • '2023_10_15-02_35_06'
  • '2023-10-15_02-35-06'

Error Starting The App

After following the guide to install this, and running it, I run into this error:

` ########## INITIALIZE START ##########

Traceback (most recent call last):
File "/home/pi/pizero_bikecomputer/pizero_bikecomputer.py", line 78, in
main()
File "/home/pi/pizero_bikecomputer/pizero_bikecomputer.py", line 23, in main
config = config.Config()
File "/home/pi/pizero_bikecomputer/modules/config.py", line 688, in init
shutil.copy(self.G_INSTALL_PATH+"layouts/"+"layout-cycling.yaml", self.G_LAYOUT_FILE)
File "/usr/lib/python3.9/shutil.py", line 418, in copy
copyfile(src, dst, follow_symlinks=follow_symlinks)
File "/usr/lib/python3.9/shutil.py", line 264, in copyfile
with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: '/root/pizero_bikecomputer/layouts/layout-cycling.yaml'
`

I'm running Pi OS 64 Bit (Full) on my Pi 02w using the Pi user

I can't use MIP display (MIP display dosen't work).

I've trouble with MIP monitor.
I could use MIP monitor by mip_test_pigpio with a few changes (only clock speed).
however,When I run the pizero_bikecomputer, the screen lights up, but nothing is displayed (displays correctly in X-window).
[my setup guide in Japanese] says to use forked PyQtGraph, but I can't find it,Is this the cause?

[GENERAL]
display = MIP
OS:Raspberry pi OS bullseye
I installed qt5 according to https://forums.raspberrypi.com/viewtopic.php?t=346805

thank you.

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.