Announcement

Collapse
No announcement yet.

Controlling E10 A LED on v1.1

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Controlling E10 A LED on v1.1

    On version 1.0 of the E10 we were able to control the A LED using the
    following:

    OFF: /usr/bin/gpio9260 -PB11
    GRN: /usr/bin/gpio9260 +PB11

    I realize this was a "back-door" type of technique. However, it was
    simple - and we were using it as an acknowledgement that the mode
    button had been pressed. Is there any similar means to control it
    in v1.1 (gpio9260 is no longer an executable, it is a link to the new button
    function)

    I understand an rpc call could be used - must I know the actual address
    of the snap radio within the e10 in use?

    Thanks

  • #2
    LED A is controlled via the co-located RF Module (RF Engine)



    However, LED B can be controlled using the 1.1 version of the OS straight from the Linux environment...

    Code:
    # For green LED
    echo 1 > /sys/class/gpio/gpio76/value
    echo 0 > /sys/class/gpio/gpio76/value
    # For red LED
    echo 1 > /sys/class/gpio/gpio77/value
    echo 0 > /sys/class/gpio/gpio77/value
    There are also shortcuts in place in /usr/bin:
    • greenled 0
    • greenled off
    • greenled 1
    • greenled on
    • redled 0
    • redled off
    • redled 1
    • redled on
    Last edited by Jheath; 11-12-2015, 09:02 AM.
    sigpic
    Proven Solutions for the Internet of Things
    www.synapse-wireless.com

    Comment


    • #3
      Found a soultion

      I've answered my own question....

      One can use a multi-cast rpc call to group 1 with a hop count of 1 and the function setLedAOff. Everyone is in group 1, and a hop count of only 1 will make sure the call does not go over the air and cause other A LEDS within range to change also.

      Comment


      • #4
        straight from the Linux environment...
        echo 1 > /sys/class/gpio/gpio76/value
        For future reference, here is how to toggle the LEDs from a python .py script running on E-20 Linux:

        Turn LED-1 RED ON:
        Code:
        led_1_red = open("/sys/class/gpio/gpio40/value","w")
        led_1_red.write(str(1))
        led_1_red.close()
        Turn LED-1 RED OFF:
        Code:
        led_1_red = open("/sys/class/gpio/gpio40/value","w")
        led_1_red.write(str(0))
        led_1_red.close()
        The GPIO definitions are in section 7 (User Buttons and LEDs ) of the E20 User Guide.

        Also, look in /usr/local/bin at the files led-a, led-b, & led-c for inspiration.
        Last edited by DLansdowne; 01-09-2016, 12:32 PM.

        Comment

        X