Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help me do the project #3

Open
grostedo opened this issue Jun 10, 2024 · 7 comments
Open

Help me do the project #3

grostedo opened this issue Jun 10, 2024 · 7 comments

Comments

@grostedo
Copy link

Hi I'm Enzo! I'm from Italy and I am 48 years old. Where are you from? How old are you?

I noticed that in your schemes there is no the pictures of the cabling of the hardwares. Can you please send me that? Can you explain what do I need to install on the SSD of the Raspberry? How to run and stop the run sessions? By pressing the button or in another way? Thank you for your help. Bye!

@Nathancrz
Copy link
Owner

Hello, I don't really have the exact electrical scheme but it is quite simple :
the powering hat is directly mounted on the pi (although i would recommend an alternative power supply method such as a LiPo battery and a power regulation module) and then every sensor is linked to the breadeboard on a dedicated channel (+3.3v, ground, SDA, SCL, GPIO 12 etc.), which is connected to the corresponding pin on the pi.
the pi is loaded with the data_logger data_logger file, a file to mount the usb stick automatically usb mounting code and finally an instruction to run "data_logger 3.py" at startup.
The wiring and the exact codes needed may vary with your needs (such as recording on the sd card rather than on a usb stick) but the method is here.
I have loaded my photos on the repository in the hope it may help you but i fear they are quite hard to understand link to the photos

@Nathancrz
Copy link
Owner

Indeed I press the button to start/stop the runs and the screen helps me see the time and how the recording is going

@Nathancrz
Copy link
Owner

I am 20 years old and I am a student in pre engineering school in France by the way :)

@grostedo
Copy link
Author

Hi, first of all: congratulations because you are young and can do these things!
I solved the issues in the code and inserted the correct path and everything works perfect.

I saw that you uploaded the pictures, but it's not understandable, however I will try! Eventually, I will bother you if I need help.

I need to buy the hardware, I already have the Raspberry PI 4, can you send me the link of the other components to purchase them? Do you also have links for linear potentiometers? I couldn't find them at a good price.
I inform you that my grandson that is 11 years old is also working on the project, he helps me with Python. I hope that a day he becomes an informatic engineer like you.

Thank you, have a great rest of your day!

@grostedo grostedo changed the title Help me to do the project Help me do the project Jun 11, 2024
@Nathancrz
Copy link
Owner

Happy to read that ! Here is a list of aliexpress links for the components. References may vary but the idea is here :
potentiometers
battery
power controller
connectors
ADC (not the one I used but better in theory)
accelerometer
big button
screen

You will need wires, a breadboard, soldering material, a shell to protect the hardware but I don't have specific references so you will have to do it by yourself.

I am working on a new version including a gps, brake sensors, replacing the screen by more buttons etc. So I would recommend you to try too but it may be a bit sketchy to integrate (and would require to revisit the code heavily).

@grostedo
Copy link
Author

Hello, I am having issues with the project.
I will list all the issues here with the related description.

Issues

  • 1. "Code de explotation" outputs nothing when I run it
    • When I run the file, it outputs nothing.
  • 2. Data Logger file has errors
    • When I run the data logger file, it outputs errors. Here is what it outputs:
   * Traceback (most recent call last):
  File "/home/davidenzo/Desktop/mtb-telemetry/Code/data_logger 3.py", line 19, in <module>
    adc = Adafruit_ADS1x15.ADS1115()
          ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/Adafruit_ADS1x15-1.0.2-py3.11.egg/Adafruit_ADS1x15/ADS1x15.py", line 319, in __init__
  File "/usr/local/lib/python3.11/dist-packages/Adafruit_ADS1x15-1.0.2-py3.11.egg/Adafruit_ADS1x15/ADS1x15.py", line 82, in __init__
  File "/home/davidenzo/.local/lib/python3.11/site-packages/Adafruit_GPIO/I2C.py", line 63, in get_i2c_device
    busnum = get_default_bus()
             ^^^^^^^^^^^^^^^^^
  File "/home/davidenzo/.local/lib/python3.11/site-packages/Adafruit_GPIO/I2C.py", line 55, in get_default_bus
    raise RuntimeError('Could not determine default I2C bus for platform.')
RuntimeError: Could not determine default I2C bus for platform.

Could you please help me fix these? Thank you.
Bye and good night!

@Nathancrz
Copy link
Owner

Hello and sorry for the late response,

"code d'exploitation" is divided in two parts so make sure to run the entire code and not only the first part. If it still doesn't work, check some of the variables such as "av" or make sure the matplotlib.pyplot module executes plots correctly.

Concerning the pi code, i have sensibly less experience with it and didn't run into the same issues as you. Apparently the code is struggling with your I2C settings which are key to use the sensors so you should configure it proporly. In order to do so, you can ask ChatGPT or Claude AI to do so (i asked them a lot of questions too)

I added "TIPE GUI 10" to the code section to help you, it's kind of a software version of "code d'exploitation" which uses custom tkinter. It's quite difficult to set up the environment to lauch it properly but 'Visual studio code' worked for me.

Best regards, Nathan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants