Git Product home page Git Product logo

Comments (15)

damyka avatar damyka commented on May 22, 2024

This is by design as this is part of a complete curriculum. The python program main.py expects that the Grove Pi hat and sensors are connected to the Pi. I was able to reproduce this by removing the hat and sensors.

To purchase a kit, or to find what hardware and sensors you need, please visit: https://aka.ms/FBFSKit

from farmbeatsforstudents.

Bananagab avatar Bananagab commented on May 22, 2024

This is by design as this is part of a complete curriculum. The python program main.py expects that the Grove Pi hat and sensors are connected to the Pi. I was able to reproduce this by removing the hat and sensors.

To purchase a kit, or to find what hardware and sensors you need, please visit: https://aka.ms/FBFSKit

I have the kit and the hat is installed. I had the air temperature sensor connected to the right port. Does it expect all sensors to be connected to work?

from farmbeatsforstudents.

damyka avatar damyka commented on May 22, 2024

All sensors are expected for complete and accurate data readings. You can run main.py without them connected but it will generate these types of errors and the serial data will not be complete with missing data points for the missing sensors, to be expected. In some cases the data will be inaccurate, for example, if the soil moisture sensor is disconnected the data will reflect the analog voltage of the input pin regardless of whether or not the sensor is attached.

[edit:] While it is possible to hot swap the sensors, removing and replacing the Sunlight Sensor may cause failure in the sensor readings (visible and infrared). Rebooting is required to reinitialize the sensor. Similarly, removing the Grove hat while the Pi is running will result in the Pi rebooting.

from farmbeatsforstudents.

damyka avatar damyka commented on May 22, 2024

To verify that the serial data is streaming from the FarmBeats application connect the Serial-TTL cable to the Pi and to your laptop, and open the serial port in a serial terminal, or Excel using Data Streamer. Then you can see in real-time the effect of missing sensors on the data being captured.

from farmbeatsforstudents.

Bananagab avatar Bananagab commented on May 22, 2024

To verify that the serial data is streaming from the FarmBeats application connect the Serial-TTL cable to the Pi and to your laptop, and open the serial port in a serial terminal, or Excel using Data Streamer. Then you can see in real-time the effect of missing sensors on the data being captured.

I tried runnning main.py with all the sensors installed. There's still some errors with DataSettings.py? And there's no information coming out to the Serial Monitor.

>>> %Run main.py
Fatal Python error: Cannot recover from stack overflow.

Thread 0xb4fa0460 (most recent call first):
  File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 483 in read
  File "/home/pi/farmbeats-datastreamer/data_streamer/DataStreamer.py", line 50 in read_data
  File "/home/pi/farmbeats-datastreamer/main.py", line 32 in read_incoming_serial
  File "/usr/lib/python3.7/threading.py", line 865 in run
  File "/usr/lib/python3.7/threading.py", line 917 in _bootstrap_inner
  File "/usr/lib/python3.7/threading.py", line 885 in _bootstrap

Current thread 0xb6f00ad0 (most recent call first):
  File "/usr/lib/python3.7/dbm/__init__.py", line 122 in whichdb
  File "/usr/lib/python3.7/dbm/__init__.py", line 78 in open
  File "/usr/lib/python3.7/shelve.py", line 227 in __init__
  File "/usr/lib/python3.7/shelve.py", line 243 in open
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 353 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings
  File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings```

from farmbeatsforstudents.

damyka avatar damyka commented on May 22, 2024

I started from scratch with a new SD card and manual install, and the only way I can repro this is when the pi hat is removed entirely. Is it possible that the pins are not perfectly aligned?

Please give me a list of the steps to repro, as detailed as possible including how you created the SD card, what shell commands, etc. I will follow them exactly and try to repro.

from farmbeatsforstudents.

Bananagab avatar Bananagab commented on May 22, 2024

I started from scratch with a new SD card and manual install, and the only way I can repro this is when the pi hat is removed entirely. Is it possible that the pins are not perfectly aligned?

Please give me a list of the steps to repro, as detailed as possible including how you created the SD card, what shell commands, etc. I will follow them exactly and try to repro.

I will restart from scratch tomorrow and I will document everything here.

from farmbeatsforstudents.

Bananagab avatar Bananagab commented on May 22, 2024
  1. Created the SD card image with fbfs.1.0.1.img.zip and Pi Imager
  2. Reinstalled the Pi Hat.
  3. Booted into the OS with the SD card
  4. Terminal → sudo chmod 777 install.sh
  5. Terminal → ./install.sh
  6. Reboot
  7. Terminal → python3 main.py
  8. Same errors : File "/home/pi/farmbeats-datastreamer/data/DataSettings.py", line 363 in save_settings

I tried all that without the sensors, just wanted main.py to run at all.

from farmbeatsforstudents.

Bananagab avatar Bananagab commented on May 22, 2024

Found the issue. The Raspberry Pi 4 outputs Serial Data to ttyAMA0 by default and not ttyS0 in DataStreamer.y

from farmbeatsforstudents.

rishabhIn avatar rishabhIn commented on May 22, 2024

I have followed the exact steps as mentioned by @Bananagab and got an error in step 8. Then I performed the following steps using sudo raspi-config --> Interface Options --> Serial.

Still getting the error of Step 8. Is there a way to troubleshoot? I was also not able to understand @Bananagab comments on the serial port.

Can you please help me to resolve this @damyka? - I am trying to get this project ready for my kid.

from farmbeatsforstudents.

damyka avatar damyka commented on May 22, 2024

@Bananagab, I now understand the problem you are having. There are 2 issues here:

  1. The application file `main.py' must be run as root user. The pi user does not have sufficient privileges.
  2. The image file fbfs.1.0.1.img.zip contains a complete installation of the FarmBeats application. There is a service the starts on boot named farmbeats-datastreamer.service which will start main.py as the root user. If you want to also run this file manually in a python shell you must first stop the service. See the section: Manually running the python application.

I will update the README to clarify installation options.

from farmbeatsforstudents.

damyka avatar damyka commented on May 22, 2024

@rishabhIn, Please see the updated README and follow the instruction in the section SD Card Installation.

from farmbeatsforstudents.

rishabhIn avatar rishabhIn commented on May 22, 2024

Hi @damyka , I have got success in the installation, after following the steps, I am getting

image

What are your thoughts? Do you think it will show the values ?

from farmbeatsforstudents.

damyka avatar damyka commented on May 22, 2024

@rishabhIn, with the SD card installation you do not need to log into to the Pi and change anything or stop/start services. After reboot the services will run automatically and assuming that the hardware build is correct, sensor data will start streaming.

Verify that serial data is streaming from the Pi by connecting the serial-ttl cable to a serial monitor.

from farmbeatsforstudents.

damyka avatar damyka commented on May 22, 2024

Instructions are updated in README and both of the install options are fully tested:

from farmbeatsforstudents.

Related Issues (7)

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.