Open jabrena opened 7 years ago
Can you provide examples in bash or python that can be run on ev3dev without installing additional software or compiling?
Are you setting up the port first? PiStorms is like BrickPi in that it cannot automatically detect sensors, so you have to set the port to ev3-uart mode and then write to the set_device
attribute. Then you can use the lego-sensor device.
Yes, for the last case you have the bash traces. I will explain.
ev3dev#1|2017-06-07 19:17:04 [main] TRACE ev3dev.utils.Sysfs - echo ev3-uart > /sys/class/lego-port/port1/mode
ev3dev#1|2017-06-07 19:17:04 [main] TRACE ev3dev.utils.Sysfs - echo lego-ev3-gyro > /sys/class/lego-port/port1/set_device
ev3dev#1|2017-06-07 19:17:05 [main] DEBUG ev3dev.hardware.EV3DevDevice - Detecting device on port: pistorms:BBS2
ev3dev#1|2017-06-07 19:17:05 [main] TRACE ev3dev.utils.Sysfs - ls /sys/class/lego-sensor
ev3dev#1|2017-06-07 19:17:05 [main] TRACE ev3dev.utils.Sysfs - cat /sys/class/lego-sensor/sensor20/address
ev3dev#1|2017-06-07 19:17:05 [main] DEBUG ev3dev.hardware.EV3DevDevice - Detected port on path: /sys/class/lego-sensor/sensor20/address
ev3dev#1|2017-06-07 19:17:05 [main] INFO ev3dev.hardware.EV3DevSensorDevice - detected lego sensor: /sys/class/lego-sensor/sensor20
ev3dev#1|2017-06-07 19:17:05 [main] TRACE ev3dev.utils.Sysfs - echo GYRO-ANG > /sys/class/lego-sensor/sensor20/mode
ev3dev#1|2017-06-07 19:17:06 [main] TRACE ev3dev.utils.Sysfs - cat /sys/class/lego-sensor/sensor20/value0
ev3dev#1|Iteration: 0
ev3dev#1|Gyro angle: -2550
As you say, for BrickPi+ & PiStorms, it is necessary to set the port to operate with the sensor:
echo ev3-uart > /sys/class/lego-port/port1/mode
echo lego-ev3-gyro > /sys/class/lego-port/port1/set_device
Later, once you have the port in the right way, it is possible to set the mode and later view the values:
echo GYRO-ANG > /sys/class/lego-sensor/sensor20/mode
cat /sys/class/lego-sensor/sensor20/value0
-2550
If you observe, the logs from ev3dev-lang-java
try to explain a bash session. :)
If you observe, the value is rare. The same idea is for other cases.
Juan Antonio
Is this still a problem?
Hi,
I am releasing the new version of EV3Dev-lang-java and I noticed that some sensors doesn´t run with PiStormsV2.
I attach the logs for every example:
EV3USSensor
EV3IRSensor
EV3GyroSensor
Anyone has reported this fact?
Juan Antonio https://github.com/ev3dev-lang-java/ev3dev-lang-java
Related issue: https://github.com/ev3dev-lang-java/ev3dev-lang-java/issues/301