GithubHelp home page GithubHelp logo

Comments (15)

JVTEAM avatar JVTEAM commented on September 1, 2024 2

Its the 2019-04-08-raspbian-stretch.zip release of raspian. I don't think there is any else special about it.

from google-coral.

soungno avatar soungno commented on September 1, 2024 2

There is a bug in the coral-enviro package.

The content of the bug is that the cs_high value setting is missing from ssd1306 (OLED Display) initialization when running on raspberry pi.

Find board.py in the coral enviro package installation directory and modify it as follows.

The source code is located in /usr/lib/python3/dist-packages/coral/enviro/board.py.

`class EnviroBoard():
"""
An interface for all input and output modules on the Environmental Sensor Board.
"""

def __init__(self):
    # Obtain the full sysfs path of the IIO devices.
    self._hdc2010 = _get_path('hdc20x0')
    self._bmp280 = _get_path('bmp280')
    self._opt3002 = _get_path('opt3001')
    self._tla2021 = _get_path('ads1015')
    # Create SSD1306 OLED instance, with SPI as the interface.
    plat = platform.platform()
    if 'mendel' in plat:
        from .rpi_gpio_periphery import pGPIO
        # Values for the Coral Dev Board (running Mendel Linux).
        # If running legacy kernel (4.9.51), use port 32766.
        port = 32766 if 'Linux-4.9.51-imx' in plat else 0
        self._display = ssd1306(serial_interface=spi(gpio=pGPIO(), port=port, device=0, gpio_DC=138, gpio_RST=140),
                                gpio=pGPIO(), height=32, rotate=2)
    else:
        # Default to RPi.GPIO in luma and defaults GPIO.
        self._display = ssd1306(serial_interface=spi(cs_high=True),
                                gpio=noop(), height=32, rotate=2)

`

from google-coral.

Luisibear98 avatar Luisibear98 commented on September 1, 2024 2

Hello, I made this work by modifying some parts of the code to directly access the sensors.
The modify code needs some extra .py classes.
Should I post it somewhere is anybody is interested?

from google-coral.

Bugierek avatar Bugierek commented on September 1, 2024 1

Thank you for the info, hopefully they'll resolve it soon.

They gave me a drive link to a new image. I tried it on a Pi Zero and it worked again.

https://drive.google.com/open?id=1LiKCdwAbSLWdIQWxqJ5Qoj7jNONKnzMY

Unfortunately the link has a restricted access, is it possible to re-up and pass the link here ?
Thanks

from google-coral.

ehagerty avatar ehagerty commented on September 1, 2024 1

Hi, I hope the following long description helps someone.

Try as I might, the limited nature of the 'getting started' doc for this board (https://coral.withgoogle.com/docs/enviro-board/get-started/) just wasn't deep or broad enough. However, I've had the great pleasure to be able to work over email with the incredibly helpful support guys at Coral. Because I have faced all the different problems on this thread, all at different times and in different combinations, I wanted to share my path to success. After lots of discussion with support, reference to how to docs that covered different bits of what we were trying to achieve, and and hours of me just not being the brightest bulb in the box, we got to the following repeatable set of steps.

This may seem overkill, but it works for me:

install completely fresh latest raspbian to an sd card
sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade
sudo reboot
sudo echo "deb https://packages.cloud.google.com/apt coral-cloud-stable main" | sudo tee /etc/apt/sources.list.d/coral-cloud.list
sudo curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
sudo apt install python3-coral-enviro
sudo reboot now

time to prove to yourself the hat works
sudo python3 enviro_demo.py

I now had a board working with all four readings, but without being part of the IOT platform, so I edited /usr/lib/python3/dist-packages/coral/envirocloud_config.ini to match my account details but leaving the encryption empty as suggested in the file. At this stage I was unable to get enviro_demo.py to run - it crashed out with the error @bryoneason was seeing at the top of this thread where the onboard crypto call in core.py was complaining about a file not found.

To get around that, I did the following:

cd /usr/lib/python3/dist-packages/coral/enviro
sudo wget https://pki.goog/roots.pem
sudo openssl genrsa -out rsa_private.pem 2048
sudo openssl rsa -in rsa_private.pem -pubout -out rsa_public.pem
sudo vi cloud_config.ini
sudo vi cloud_config.ini <set all other variables to match all the rest of your gcloud settings, region etc>

time to prove to yourself everything works
sudo python3 enviro_demo.py

For me, I now have a pi, connected to the internet over my local wifi, connected to my gcp account, using the encryption keys I created, which has been running for days, all the way through pubsub and dataflow to bigquery. It has inserted tens of thousands of rows successfully.

*NB, if you want to do the same thing as a semi-tutorial (accepting i'm hardly a good tutor of anything) you'll need to:

  1. enable apis for pubsub, dataflow, bigquery and storage first, then:

  2. go to the IOT dashboard, create a new registry (remember the region), create a new device and make sure to add the public key you created above.

  3. go to the pubsub dashboard, create a new topic, then create a new subscription (delivery type set to pull) for that topic

  4. go back to the topic screen, select your topic, and from the dropdown select 'export to bigquery'

  5. now over in the dataflow dashboard, give the flow a name, change the Cloud Dataflow Template from 'topic to bigquery' to 'subscription to bigquery', make sure you set the region to match everything else you are doing, and enter the topic you made above

  6. in another tab, go into the bigquery dashboard and create a dataset and a table within that with the following structure:

field name | Type | Mode |


humidity | FLOAT | NULLABLE
pressure | FLOAT | NULLABLE
temperature | FLOAT | NULLABLE
ambient_light | FLOAT | NULLABLE

  1. In another tab go into the Storage Browser, create a bucket and remember its name

  2. Now go back to your half complete dataflow, and fill in the output table name with the details you created above and also enter the name of the storage bucket you created and put it in the Temporary Location field and finally set the flow running

  3. go back to the bigquery dashboard, and in the query editor, you can use this to start to see your data:
    SELECT * FROM <project id>:<dataset>.<table> LIMIT 1000

Alone, without the help of these tutorials:

https://cloud.google.com/community/tutorials/cloud-iot-rtdp
https://cloud.google.com/community/tutorials/cloud-iot-gateways-rpi

and the fantastic support of [email protected] plus quite a lot of hours of me assuming I was wrong and hacking at things, this does all work very well indeed.

PS - I've probably missed out some steps or oversimplified others, but hopefully all this is of some assistance to someone.

from google-coral.

brianthelion avatar brianthelion commented on September 1, 2024

@bryoneason This may just be a problem with the doc you were trying to follow. The doc claims

[The board] includes a secure cryptoprocessor with Google keys to enable connectivity with Google Cloud IoT Core services, allowing you to securely connect to the device and then collect, process, and analyze the sensor data.

Seems like that RSA key is missing, but it doesn't really make sense that Google would bundle a single key inside the .debs they had you install with apt. They'd want you to have a personalized key. I'm guessing you need to create an account on that Google IoT Core service, create the key there, and then install it in your home directory or something.

from google-coral.

lleonid avatar lleonid commented on September 1, 2024

An update has been pushed to resolve a kernel configuration issue.
You need to uninstall previous packages and then update via
sudo apt-get purge python3-coral-enviro
sudo apt autoremove
sudo apt-get update
sudo apt-get upgrade

Then follow https://coral.withgoogle.com/docs/enviro-board/get-started/ again.

from google-coral.

KrasowskiMichal avatar KrasowskiMichal commented on September 1, 2024

Hi,
I am also going through the demo of ESB setup. I can run the demo code, however, I am not getting the sensor result. Instead on display, I get "nan" value generated by the program (due to "null" value exception).

Environment used:
hardware: Raspberry Pi Zero

cat /proc/version
Linux version 4.19.42+ (xx@yy) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611)) #1219 Tue May 14 21:16:38 BST 2019
gcc --version
gcc (Raspbian 6.3.0-18+rpi1+deb9u1) 6.3.0 20170516
python3 --version
Python 3.5.3

Exact commands used:

python3 enviro_demo.py

(note: using with sudo I have the same error)

Result: (OLED display)
Light: nan lux
Pressure: nan kPa
Temp: nan C
RH nan %
(looped)

Result (stdout):
Cloud IoT is disabled per configuration.
(this is expected, I have not configured IoT yet)

Expected result:
I expected real numbers of temperature, pressure, etc.. to show up at this stage (even without IoT setup).

Suggestions on how to proceed would be welcome ;)

from google-coral.

varleyd avatar varleyd commented on September 1, 2024

Hi,
I am also going through the demo of ESB setup. I can run the demo code, however, I am not getting the sensor result. Instead on display, I get "nan" value generated by the program (due to "null" value exception).

Environment used:
hardware: Raspberry Pi Zero

cat /proc/version
Linux version 4.19.42+ (xx@yy) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611)) #1219 Tue May 14 21:16:38 BST 2019
gcc --version
gcc (Raspbian 6.3.0-18+rpi1+deb9u1) 6.3.0 20170516
python3 --version
Python 3.5.3

Exact commands used:

python3 enviro_demo.py

(note: using with sudo I have the same error)

Result: (OLED display)
Light: nan lux
Pressure: nan kPa
Temp: nan C
RH nan %
(looped)

Result (stdout):
Cloud IoT is disabled per configuration.
(this is expected, I have not configured IoT yet)

Expected result:
I expected real numbers of temperature, pressure, etc.. to show up at this stage (even without IoT setup).

Suggestions on how to proceed would be welcome ;)

just to say I've the exact same problem.
Looking at this (board.py) it searches /sys/bus/iio/devices but I've no /sys/bus/iio directory. Should this have been created by the EEPROM on the Environmental Board described in the getting started notes as creating the device tree?

thanks.

from google-coral.

ehagerty avatar ehagerty commented on September 1, 2024

Hi, I thought perhaps it was the fact that the docs didn't really make clear (if) it needed I2C and SPI turned on via raspi-config. However, even now that I've enabled them that way and rebooted, there are still no readings. Everything says 'nan'.

from google-coral.

JVTEAM avatar JVTEAM commented on September 1, 2024

This had been previously working on my Coral Dev board. Now I'm getting a note that says "No crypto detected, using SW." and I'm getting "nan" on my readings.

from google-coral.

Bugierek avatar Bugierek commented on September 1, 2024

I also have similar issue. Readings show 'nan' for all the sensors

from google-coral.

JVTEAM avatar JVTEAM commented on September 1, 2024

FYI, I had the same issue. Then I tried it on my Coral Dev board and it worked...however days later the nan value returned.

I contacted support and they told me that "Latest version of Raspbian is breaking few Coral modules and our team is working on to fix that."

They gave me a drive link to a new image. I tried it on a Pi Zero and it worked again.

https://drive.google.com/open?id=1LiKCdwAbSLWdIQWxqJ5Qoj7jNONKnzMY

from google-coral.

jeffreycunn avatar jeffreycunn commented on September 1, 2024

soungno, thanks for the insights on the cs_high=True flag in board.py. This fixed my first error....also main getting started instructions are definitely lacking in detail. The docs should include enabling SPI and ISC

I have the LED displaying, but now I am getting NAN values....will look above to see if other suggestions fix.

from google-coral.

Luisibear98 avatar Luisibear98 commented on September 1, 2024

soungno, thanks for the insights on the cs_high=True flag in board.py. This fixed my first error....also main getting started instructions are definitely lacking in detail. The docs should include enabling SPI and ISC

I have the LED displaying, but now I am getting NAN values....will look above to see if other suggestions fix.

Some of the libraries are a little bit buggy, thats only one of the bugs

from google-coral.

Related Issues (20)

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.