(Solved) Unable to get any information from the sensors

Hi,

I just received my Creator today and wanted to see if I can get it up and running.
Installing MOS was not a problem I guess, but running apps like sensorTest doesn’t work. Every sensor is “requested but not activated”.

I googled a lot, I followed all the suggestions in this forum, but yet I am not able to get any info out of the system:

  1. updated everything (incl. Raspbian)
  2. switched to “master” branch (it was set to dev) and updated everything
  3. switched to “production” env on both the PI and my machine (matrix-cli)
  4. manually updated MOS
  5. ran ‘npm run upgrade’ which seems to be the same as running the update commands manually
  6. ran ‘npm run test’ but it seems to fail at some point
  7. I even reset the password of the pi user to the standard just in case this might be important somehow

I don’t know what to do.
Ping, the ‘clock’ app and simple things like activating LEDs works, but none of the sensors are available.

Do I need to run ‘node index.js’ as sudo somehow?

Also I don’t see anything in the dashboard (dash.admobilize.com) and I also can’t log into the mobile app.
Did I miss some setup step?
I really don’t know what to do, I feel I have tried every suggestion in this forum and still it isn’t working.

can or did you completely power off the device and tried again?

That’s not the typical admin response. :slight_smile: It has often happened to me that the i2c devices (sensors) could not be addressed by the SAM3.

Solution 1: power cycle the device (easy)
Solution 2: running ‘i2cdetect -y 1’ on the rpi with i2c-bus enabled. (advanced, but can be done remotely)

1 Like

The device was turned off over night, I just restarted it.
Somehow it looks different from yesterday, because the LED “D48” is blinking constantly, and LED “D49” is glowing permanently.
Yesterday (I guess) D49 and D50 were glowing permanently and D48 was turned off.
So solution 1 didn’t help :slightly_smiling_face:

Solution2:
At first ‘i2cdetect -y 1’ didn’t work, neither as user nor with sudo. I had to enable I2C with raspi-config.
Now it shows the following output:

 0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f

00: – -- – -- – -- – -- – -- – -- –
10: – -- – -- – -- – -- – -- – -- 1c – -- –
20: – -- – -- – -- – -- – -- – -- – -- – --
30: – -- – -- – -- – -- 38 39 – -- – -- – --
40: – -- – -- – -- – -- – -- – -- – -- – --
50: – -- – -- – -- – -- – -- – -- – -- – 5f
60: 60 – -- – -- – -- – -- – 6a – -- – -- –
70: – -- – -- – -- – --

I will restart everything again after I2C has been enabled.

i2c does not need to be enabled the devices are accessed by the FPGA trough i2x and exported over SPI. but the RPi FPGA ans SAM3 share the same i2c bus. so what you see hare are the sensor device adresses.

Hmmm now the Infityloop (and ping) isn’t working anymore. LED D48 glows weak, D45 is suddenly turned on and D49 is glowing as well.

can you follow the steps here:

you maybe are using a bad power supply. is it rated with min 2.5A?

first try:

pi@matrixcreator:/usr/share/matrixlabs/matrixio-devices$ sudo /usr/share/matrixlabs/matrixio-devices/matrix-init.bash
**** MATRIX Creator FPGA has been programmed!
INFO: [/dev/spidev0.0] was opened
MATRIX device has not been detected
FPGA IDENTIFY = 0
FPGA VERSION = 10c4c
MATRIX device has not been detected

second try:

pi@matrixcreator:/usr/share/matrixlabs/matrixio-devices$ sudo /usr/share/matrixlabs/matrixio-devices/matrix-init.bash
**** MATRIX Creator FPGA has been programmed!
INFO: [/dev/spidev0.0] was opened
FPGA IDENTIFY = 5c344e8
FPGA VERSION = 10008
*** MATRIX Creator initial process has been launched
./em358-program.bash: line 71: echo: write error: Device or resource busy
./em358-program.bash: line 21: /sys/class/gpio/gpio4/direction: No such file or directory
md5sum: /tmp/em358_dump: No such file or directory
./em358-program.bash: line 21: /sys/class/gpio/gpio4/direction: No such file or directory
*** Running the program instead of the bootloader
./sam3-program.bash: line 89: echo: write error: Device or resource busy
./sam3-program.bash: line 20: /sys/class/gpio/gpio4/direction: No such file or directory
Running the program instead of the bootloader
**** Could not program SAM3 MCU, you must be check the logfile /tmp/sam3-program.log

Then I ran fpga-program.
First try:

pi@matrixcreator:/usr/share/matrixlabs/matrixio-devices$ sudo ./fpga-program.bash
**** MATRIX Creator FPGA has been programmed!
INFO: [/dev/spidev0.0] was opened
MATRIX device has not been detected
FPGA IDENTIFY = 0
FPGA VERSION = 10c4c

second try:

pi@matrixcreator:/usr/share/matrixlabs/matrixio-devices$ sudo ./fpga-program.bash
**** MATRIX Creator FPGA has been programmed!
INFO: [/dev/spidev0.0] was opened
FPGA IDENTIFY = 5c344e8
FPGA VERSION = 10008

Somehow FPGA IDENTIFY changes its value.

Logfile content:

pi@matrixcreator:/usr/share/matrixlabs/matrixio-devices$ cat /tmp/sam3-program.log
Open On-Chip Debugger 0.10.0-dev-g629c2417 (2017-11-08-21:47)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
SysfsGPIO nums: tck = 17, tms = 4, tdi = 22, tdo = 27
SysfsGPIO num: trst = 18
trst_only separate trst_push_pull
adapter speed: 128 kHz
Warn : em357.bs: nonstandard IR value
Warn : Specify TAP ‘sam3n.cpu.cpu’ by name, not number 3
Info : SysfsGPIO JTAG/SWD bitbang driver
Info : JTAG only mode enabled (specify swclk and swdio gpio to add SWD mode)
Warn : gpio 4 is already exported
Error: Couldn’t set direction for gpio 4
sysfsgpio: : No such file or directory
Error: Couldn’t unexport gpio 4
Error: Couldn’t unexport gpio 4
Error: Couldn’t unexport gpio 22
Error: Couldn’t unexport gpio 27

it seems tto have problem exporting the gpio devices. can you try to export them manually (optional as root).

ls /sys/class/gpio/gpio4
echo 4 > /sys/class/gpio/export
ls /sys/class/gpio/gpio4

if that is not working you can try this steps without a creator attached, to see if it works without the creator.
maybe disabling the creator firmware init make sense when the board ist detached

sudo systemctl disable matrixio-devices-firmware.service
reboot

What rpi board are you running?

Unfortunately it doesn’t work, neither as root nor without the creator board:

pi@matrixcreator:~$ sudo ls /sys/class/gpio/gpio4
ls: cannot access ‘/sys/class/gpio/gpio4’: No such file or directory
pi@matrixcreator:~$ sudo echo 4 > /sys/class/gpio/export
echo: write error: Device or resource busy

I’m using the Raspberry Pi 2 B+

hmm strange do you have some service/script running using gpio?

i recommend this three tests:

  1. sudo cat /sys/kernel/debug/gpio <-- check what is using gpio4
  2. disable i2c again and try the export tests again
  3. try a clean install of raspbian (stretch) and test the export again

normaly if everything is fine the output should be something like:

gpiochip0: GPIOs 0-53, parent: platform/3f200000.gpio, pinctrl-bcm2835:
 gpio-16  (                    |sysfs               ) out hi
 gpio-18  (                    |sysfs               ) out hi
 gpio-19  (                    |sysfs               ) out hi
 gpio-20  (                    |sysfs               ) out hi
 gpio-21  (                    |sysfs               ) out hi
 gpio-23  (                    |sysfs               ) out hi
 gpio-29  (                    |led0                ) out lo

gpiochip1: GPIOs 128-135, brcmexp-gpio, can sleep:
 gpio-130 (                    |led1                ) out lo

gpio 0-53 (rpi ) 128-135(matrix)

gpio-4 seems to be used by w1:

gpiochip0: GPIOs 0-53, parent: platform/3f200000.gpio, pinctrl-bcm2835:
gpio-4 ( |w1 ) in hi
gpio-6 ( |sysfs ) in hi IRQ
gpio-16 ( |sysfs ) out hi
gpio-18 ( |sysfs ) out hi
gpio-19 ( |sysfs ) out hi
gpio-20 ( |sysfs ) out hi
gpio-21 ( |sysfs ) out hi
gpio-23 ( |sysfs ) out hi
gpio-35 ( |led1 ) in hi
gpio-47 ( |led0 ) out lo

I try to disable i2c again now…

it seems you have 1-wire enabled using gpio 4. try disabling it with rapsi-config (interfaces)

2 Likes

Hi,

it seems to work now, at least I can get some sensor output.
The trick for me was

  1. DISABLE 1-wire
  2. ENABLE I2C
  3. Run the init Script again

I can get data from UV and temp sensors, I have not checked the other ones yet.

Thanks for your help, I guess that my problems seem to be fixed now!

:+1: if you want you can prefix the topic with (Solved)

1 Like