Skip to content

ERROR ev3dev.utils.Sysfs - File: '/sys/class/tacho-motor/motor9/command' without write permissions. #554

Description

@robl0377

Have installed ev3dev on debian stretch on my EV3 Brick and tried the sample program
example.robotics.ev3.actuator.motor.BasicMotorOperationExample from yesterday's template-project-gradle:

package example.robotics.ev3.actuator.motor;

import ev3dev.actuators.lego.motors.EV3LargeRegulatedMotor;
import lejos.hardware.port.MotorPort;
import lejos.utility.Delay;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

class BasicMotorOperationExample {
    public static final EV3LargeRegulatedMotor mA = new EV3LargeRegulatedMotor(MotorPort.B);
    public static Logger LOGGER = LoggerFactory.getLogger(BasicMotorOperationExample.class);
    public static int DELAY = 2000; //2 Seconds

    public static void main(String[] args) {
        mA.brake();
        LOGGER.info("Starting motor on B");
        mA.setSpeed(500);
        LOGGER.info("Forward");
        mA.forward();
        LOGGER.info("Large Motor is moving: {}, at speed {}", mA.isMoving(), mA.getSpeed());
        Delay.msDelay(DELAY);
        LOGGER.info("Stop");
        mA.stop();
        LOGGER.info("Large Motor is moving: {}, at speed {}", mA.isMoving(), mA.getSpeed());
        Delay.msDelay(DELAY);
        LOGGER.info("Backward");
        mA.backward();
        LOGGER.info("Large Motor is moving: {}, at speed {}", mA.isMoving(), mA.getSpeed());
        Delay.msDelay(2000);
        LOGGER.info("Stop");
        mA.stop();
        LOGGER.info("Large Motor is moving: {}, at speed {}", mA.isMoving(), mA.getSpeed());
        Delay.msDelay(DELAY);
        LOGGER.info("Forward");
        mA.forward();
        Delay.msDelay(2000);
        mA.stop();
        LOGGER.info("Stop");
    }
}

On the ssh console I get this:

> Task :remoteRun
java -server -jar /home/robot/EV3dev_Examples-all-0.3.0.jar 
ev3dev#27|2018-11-07 11:51:05 [main] DEBUG ev3dev.hardware.EV3DevDistros - Debian Stretch detected
ev3dev#27|2018-11-07 11:51:06 [main] DEBUG ev3dev.hardware.EV3DevDistros - Debian Stretch detected
ev3dev#27|2018-11-07 11:51:06 [main] DEBUG ev3dev.hardware.EV3DevFileSystem - Root Path: /sys/class
ev3dev#27|2018-11-07 11:51:07 [main] INFO  e.a.lego.motors.BaseRegulatedMotor - Configuring motor connected on Port: B
ev3dev#27|2018-11-07 11:51:07 [main] DEBUG e.a.lego.motors.BaseRegulatedMotor - Detecting motor on port: ev3-ports:outB
ev3dev#27|2018-11-07 11:51:07 [main] DEBUG ev3dev.hardware.EV3DevDevice - Detected device on path: /sys/class/lego-port/port5/address, ev3-ports:outB
ev3dev#27|2018-11-07 11:51:07 [main] DEBUG e.a.lego.motors.BaseRegulatedMotor - Setting port in mode: tacho-motor
ev3dev#27|2018-11-07 11:51:08 [main] DEBUG ev3dev.hardware.EV3DevDevice - Detected device on path: /sys/class/tacho-motor/motor9/address, ev3-ports:outB
ev3dev#27|2018-11-07 11:51:09 [main] ERROR ev3dev.utils.Sysfs - File: '/sys/class/tacho-motor/motor9/command' without write permissions.
ev3dev#27|Exception in thread "main" java.lang.ExceptionInInitializerError
ev3dev#27|Caused by: java.lang.RuntimeException: Operation not executed: /sys/class/tacho-motor/motor9/command with value reset
ev3dev#27|	at ev3dev.hardware.EV3DevDevice.setStringAttribute(EV3DevDevice.java:118)
ev3dev#27|	at ev3dev.actuators.lego.motors.BaseRegulatedMotor.<init>(BaseRegulatedMotor.java:94)
ev3dev#27|	at ev3dev.actuators.lego.motors.EV3LargeRegulatedMotor.<init>(EV3LargeRegulatedMotor.java:26)
ev3dev#27|	at example.robotics.ev3.actuator.motor.BasicMotorOperationExample.<clinit>(BasicMotorOperationExample.java:16)

Java Runtime:

openjdk version "10" 2018-03-20
OpenJDK Runtime Environment (build 10+46-ev3)
OpenJDK Client VM (build 10+46-ev3, mixed mode, sharing)

Main libraries:

  • ev3dev-lang-java-2.4.7-SNAPSHOT.jar
  • lejos-commons-0.7.1.jar

However, it works on Oracle Java 8

java version "1.8.0"
Java(TM) SE Embedded Runtime Environment (build 1.8.0-b132, headless)
Java HotSpot(TM) Embedded Client VM (build 25.0-b70, mixed mode)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions