Skip to content

ev3dev-stretch #339

Closed
Closed

Description

@dlech

Following up on #338 (comment)

ev3dev-lang-python is already broken in ev3dev-stretch

How so? That seems pretty important. Can you open a new issue for it?

https://github.com/ev3dev/ev3dev-kpkg/blob/ev3dev-stretch/ev3dev-ev3/changelog

  • Breaking change: LEDs are renamed to mainline kernel names
    • Names will be similar to "led0:red:brick-status"
  • Breaking change: EV3/EVB input/output port drivers are merged
    • EV3 port names will be similar to "ev3-ports:in1".

Activity

  1. dlech commented on Sep 4, 2017

    @dlech
    MemberAuthor

    Important info for package maintainer:

    in debian/changelog, stable in the line

    python-ev3dev (0.8.1) stable; urgency=medium
    

    will upload to jessie.

    To upload to stretch, use testing.

    python-ev3dev (0.8.1) testing; urgency=medium
    

    UPDATE:

    Also, things will break if you upload the same version number to both distros, so don't do exactly as shown above.

  2. dlech commented on Sep 4, 2017

    @dlech
    MemberAuthor

    For all of the ev3dev packages I maintain, I have created an ev3dev-jessie branch and an ev3dev-stretch branch. I've basically adopted (something like) the Debian policy for stable and testing, which is only critical bug/security fixes go into stable (jessie in our case), no new features. You can do what you like, including new features and breaking changes in testing (stretch in our case).

  3. WasabiFan commented on Sep 4, 2017

    @WasabiFan
    Member

    https://github.com/ev3dev/ev3dev-kpkg/blob/ev3dev-stretch/ev3dev-ev3/changelog

    Oh, damn... when I originally read that I thought all the changes were on the EVB/BrickPi side. Looks like we'll need to fix those.

    For all of the ev3dev packages I maintain, I have created an ev3dev-jessie branch and an ev3dev-stretch branch.

    I think we've gotten to the point where that convention would work well here. We'll need to figure out whether we want to maintain a "dev" branch or not. List of things that will be impacted (not necessarily complete):

    • CI builds (I think we have some configuration which points to branch names, or at least we did)
    • Documentation versions and labels
    • Contribution info (somewhere we added an explanation of develop vs. master)
  4. self-assigned this
    on Sep 7, 2017
  5. dwalton76 commented on Sep 8, 2017

    @dwalton76
    Collaborator

    So branches and branch names...some options

    option 1

    • rename master to ev3dev-lang-python-jessie
    • create a child branch called ev3dev-lang-python-stretch
    • create a ev3dev-lang-python-stretch-develop child branch off of ev3dev-lang-python-stretch
    • change the default branch to ev3dev-lang-python-stretch
    • delete todays develop branch

    option 2 drop the ev3dev-lang-python- part of the branch names

    • rename master to jessie
    • create a child branch called stretch
    • create a stretch-develop child branch off of stretch
    • change the default branch to stretch
    • delete todays develop branch

    I like option 2 myself, the names are much shorter and easier to type and we already know that are are in the ev3dev-lang-python- repo, it feels redundant to also put that in the branch names.

    Most future dev would happen in stretch-develop and then we merge into stretch the same we way merge develop -> master today. We then git cherry-pick SHA any commit that also needs to go into jessie.

  6. ddemidov commented on Sep 8, 2017

    @ddemidov
    Member

    We could just tag the current master with jessie, and promise to never look back (move all development to stretch).

  7. dwalton76 commented on Sep 9, 2017

    @dwalton76
    Collaborator

    @dlech @ddemidov need a pointer here on how to use the ev3dev-lang stuff

    For the LEDs I need to make this change...I did the following manually just as a quick test. I did not use the templates

    diff --git a/ev3dev/ev3.py b/ev3dev/ev3.py
    index 725f713..8639784 100644
    --- a/ev3dev/ev3.py
    +++ b/ev3dev/ev3.py
    @@ -47,10 +47,10 @@ class Leds(object):
     
     # ~autogen led-colors platforms.ev3.led>currentClass
     
    -    red_left = Led(name_pattern='ev3:left:red:ev3dev')
    -    red_right = Led(name_pattern='ev3:right:red:ev3dev')
    -    green_left = Led(name_pattern='ev3:left:green:ev3dev')
    -    green_right = Led(name_pattern='ev3:right:green:ev3dev')
    +    red_left = Led(name_pattern='led0:red:brick-status')
    +    red_right = Led(name_pattern='led1:red:brick-status')
    +    green_left = Led(name_pattern='led0:green:brick-status')
    +    green_right = Led(name_pattern='led1:green:brick-status')
     
         LEFT = ( red_left, green_left, )
         RIGHT = ( red_right, green_right, )
    

    but to make this permanent I need to use templates so I make this change

    dwalton@laptop ~/l/e/e/autogen> git diff
    diff --git a/spec.json b/spec.json
    index 0891772..ea708c2 100644
    --- a/spec.json
    +++ b/spec.json
    @@ -1482,10 +1482,10 @@
             "ev3": {
                 "led": {
                     "instances": [
    -                    { "name" : "Red Left", "systemName": "ev3:left:red:ev3dev" },
    -                    { "name" : "Red Right", "systemName": "ev3:right:red:ev3dev" },
    -                    { "name" : "Green Left", "systemName": "ev3:left:green:ev3dev" },
    -                    { "name" : "Green Right", "systemName": "ev3:right:green:ev3dev" }
    +                    { "name" : "Red Left", "systemName": "led0:red:brick-status" },
    +                    { "name" : "Red Right", "systemName": "led1:red:brick-status" },
    +                    { "name" : "Green Left", "systemName": "led0:green:brick-status" },
    +                    { "name" : "Green Right", "systemName": "led1:green:brick-status" }
                     ],
                     "groups" : [
                         { "name" : "Left", "entries" : ["Red Left", "Green Left"] },
    dwalton@laptop ~/l/e/e/autogen> 
    

    I then reverted the changes I made to ev3dev/ev3.py and now want to make those changes using the templates. The README at ev3dev-lang does not have instructions on how to use the contents of the repo. The README in the autogen directory has a little...I cced to the autgen directory and ran npm install and it installed some stuff. I thought maybe I'm supposed to run the following but thats not it

    dwalton@laptop ~/l/ev3dev-lang-python> node ev3dev-lang/autogen/autogen.js 
    module.js:328
        throw err;
        ^
    
    Error: Cannot find module 'liquid-node'
        at Function.Module._resolveFilename (module.js:326:15)
        at Function.Module._load (module.js:277:25)
        at Module.require (module.js:354:17)
        at require (internal/module.js:12:17)
        at Object.<anonymous> (/home/dwalton/lego/ev3dev-lang-python/ev3dev-lang/autogen/autogen.js:13:25)
        at Module._compile (module.js:410:26)
        at Object.Module._extensions..js (module.js:417:10)
        at Module.load (module.js:344:32)
        at Function.Module._load (module.js:301:12)
        at Function.Module.runMain (module.js:442:10)
    dwalton@laptop ~/l/ev3dev-lang-python> 
    

    How do I the use contents of ev3dev-lang to build a new ev3dev/ev3.py using my new spec.json?

  8. dwalton76 commented on Sep 9, 2017

    @dwalton76
    Collaborator

    @dlech I installed https://oss.jfrog.org/list/oss-snapshot-local/org/ev3dev/brickstrap/2017-09-02/snapshot-ev3dev-stretch-bone-generic-2017-09-01.img.xz on my EVB but it is kernel 4.9.41 instead of 4.9.42

    robot@evb[ev3dev-lang-python]# ev3dev-sysinfo 
    Image file:         ev3dev-stretch-bone-generic-2017-09-01
    Kernel version:     4.9.41-ev3dev-1.4.0-bb.org
    /usr/bin/ev3dev-sysinfo: line 68: warning: command substitution: ignored null byte in input
    Board:              TI AM335x BeagleBone Black
    Revision:           000c
    Brickman:           0.10.0
    ev3devKit:          0.5.2
    robot@evb[ev3dev-lang-python]# 
    

    Will the the next binary be 4.9.42? If so I'll hold off for it to work on

    Breaking change: EV3/EVB input/output port drivers are merged
    EV3 port names will be similar to "ev3-ports:in1".
    
  9. dlech commented on Sep 9, 2017

    @dlech
    MemberAuthor

    The important part of the kernel version is ev3dev-1.4.0. The 4.9.x comes from the upstream kernels for the various devices, so they don't always match. You can also find a BeagleBone specific changelog at https://github.com/ev3dev/ev3dev-kpkg/blob/ev3dev-stretch/ev3dev-bb.org/changelog.

  10. WasabiFan commented on Sep 9, 2017

    @WasabiFan
    Member

    node ev3dev-lang/autogen/autogen.js

    That's the right command. I'm guessing that the npm install command didn't succeed. Can you post the output?

  11. dwalton76 commented on Sep 9, 2017

    @dwalton76
    Collaborator

    attempting to run from root of ev3dev-lang-python but it needs package.json

    dwalton@laptop ~/l/ev3dev-lang-python> npm install
    npm WARN enoent ENOENT: no such file or directory, open '/home/dwalton/lego/ev3dev-lang-python/package.json'
    npm WARN ev3dev-lang-python No description
    npm WARN ev3dev-lang-python No repository field.
    npm WARN ev3dev-lang-python No README data
    npm WARN ev3dev-lang-python No license field.
    dwalton@laptop ~/l/ev3dev-lang-python> 
    

    so running from ev3dev-lang/autogen/ where there is a package.json but the postintsall barfs

    dwalton@laptop ~/l/ev3dev-lang-python> cd ev3dev-lang/autogen/
    dwalton@laptop ~/l/e/e/autogen> sudo npm install
    [sudo] password for dwalton: 
    npm WARN lifecycle [email protected]~postinstall: cannot run in wd %s %s (wd=%s) [email protected] cd node_modules/liquid-node && npm install && npm run compile /home/dwalton/lego/ev3dev-lang-python/ev3dev-lang/autogen
    npm WARN [email protected] requires a peer of bluebird@^2.1.3 but none was installed.
    npm WARN [email protected] No repository field.
    npm WARN [email protected] No license field.
    dwalton@laptop ~/l/e/e/autogen> 
    dwalton@laptop ~/l/e/e/autogen> ls
    autogen-core.js  autogen.js  config.js  node_modules/  package.json  README.rst  utils.js
    dwalton@laptop ~/l/e/e/autogen> cat package.json 
    {
      "name": "ev3dev-lang-autogen",
      "version": "1.0.0",
      "description": "Dependencies for ev3dev-lang autogen",
      "main": "autogen.js",
      "dependencies": {
        "liquid-node": "git://github.com/WasabiFan/liquid-node.git",
        "yargs": "~3.29.0"
      },
      "devDependencies": {},
      "scripts": {
        "test": "echo \"TODO\" && exit 1",
        "postinstall":  "cd node_modules/liquid-node && npm install && npm run compile"
      },
      "homepage": "https://github.com/ev3dev/ev3dev-lang"
    }
    dwalton@laptop ~/l/e/e/autogen> 
    

    there is a node_modules in the root dir of ev3dev-lang-python but it is empty

    dwalton@laptop ~/l/ev3dev-lang-python> ls -l node_modules/
    total 0
    dwalton@laptop ~/l/ev3dev-lang-python> 
    
  12. dwalton76 commented on Sep 9, 2017

    @dwalton76
    Collaborator

    "The important part of the kernel version" everything on my EVB is working though, touch sensors work, motors work, etc....it feels like I don't have the Breaking change

  13. WasabiFan commented on Sep 9, 2017

    @WasabiFan
    Member

    @dwalton76 The npm issue has been resolved; a version of a package that script depended on was deprecated and npm didn't handle it well. You should be able to run npm install and go from there without issue now.

  14. dlech commented on Sep 9, 2017

    @dlech
    MemberAuthor

    .it feels like I don't have the Breaking change

    That's because there were no breaking changes for EVB. It doesn't have LEDs and the port names only changed for EV3.

  15. dwalton76 commented on Sep 9, 2017

    @dwalton76
    Collaborator

    and the port names only changed for EV3
    @dlech other than the LEDs what things should I see breaking? I did have to fix LEDs but motors and touch sensors still work for me on EV3.

  16. dwalton76 commented on Sep 9, 2017

    @dwalton76
    Collaborator

    @WasabiFan I'm not clear on how what I run from which directories. If I run npm install from the ev3dev-lang-python directory it barfs because there is no package.json

    dwalton@laptop ~/l/ev3dev-lang-python> sudo npm install
    [sudo] password for dwalton: 
    npm WARN enoent ENOENT: no such file or directory, open '/home/dwalton/lego/ev3dev-lang-python/package.json'
    npm WARN ev3dev-lang-python No description
    npm WARN ev3dev-lang-python No repository field.
    npm WARN ev3dev-lang-python No README data
    npm WARN ev3dev-lang-python No license field.
    dwalton@laptop ~/l/ev3dev-lang-python> 
    

    There is a package.json in ev3dev-lang/autogen/ so I run npm install from there but it barfs because there is no node_modules/liquid-node directory.

    dwalton@laptop ~/l/ev3dev-lang-python> cd ev3dev-lang/autogen/
    dwalton@laptop ~/l/e/e/autogen> sudo npm install
    npm WARN lifecycle [email protected]~postinstall: cannot run in wd %s %s (wd=%s) [email protected] cd node_modules/liquid-node && npm install && npm run compile /home/dwalton/lego/ev3dev-lang-python/ev3dev-lang/autogen
    npm WARN [email protected] requires a peer of bluebird@^2.1.3 but none was installed.
    npm WARN [email protected] No repository field.
    npm WARN [email protected] No license field.
    dwalton@laptop ~/l/e/e/autogen> 
    
  17. dlech commented on Sep 9, 2017

    @dlech
    MemberAuthor

    other than the LEDs what things should I see breaking?

    Are you using the constants for the port names?

  18. dwalton76 commented on Sep 9, 2017

    @dwalton76
    Collaborator

    I've tried with and without for the touch sensor

    -rwxr-xr-x 1 robot robot  407 Sep  9 01:19 touch_sensor.py
    robot@ev3alt[utils]# cat touch_sensor.py 
    #!/usr/bin/env python3
    
    """
    Used to test TouchSensor basics
    """
    
    from ev3dev.auto import TouchSensor, INPUT_1
    import logging
    import sys
    
    # logging
    logging.basicConfig(level=logging.INFO,
                        format="%(asctime)s %(levelname)5s: %(message)s")
    log = logging.getLogger(__name__)
    
    ts = TouchSensor(INPUT_1)
    
    if ts.is_pressed:
        log.info("TS is pressed")
    else:
        log.info("TS is NOT pressed")
    robot@ev3alt[utils]# 
    robot@ev3alt[utils]# 
    

    For motors I am using

    robot@ev3alt[utils]# cat move_motor.py 
    #!/usr/bin/env python3
    
    """
    Used to adjust the position of a motor in an already assembled robot
    where you can"t move the motor by hand.
    """
    
    from ev3dev.auto import OUTPUT_A, OUTPUT_B, OUTPUT_C, OUTPUT_D, Motor
    import argparse
    import logging
    import sys
    
    # command line args
    parser = argparse.ArgumentParser(description="Used to adjust the position of a motor in an already assembled robot")
    parser.add_argument("motor", type=str, help="A, B, C or D")
    parser.add_argument("degrees", type=int)
    parser.add_argument("-s", "--speed", type=int, default=50)
    args = parser.parse_args()
    
    # logging
    logging.basicConfig(level=logging.INFO,
                        format="%(asctime)s %(levelname)5s: %(message)s")
    log = logging.getLogger(__name__)
    
    if args.motor == "A":
        motor = Motor(OUTPUT_A)
    elif args.motor == "B":
        motor = Motor(OUTPUT_B)
    elif args.motor == "C":
        motor = Motor(OUTPUT_C)
    elif args.motor == "D":
        motor = Motor(OUTPUT_D)
    else:
        raise Exception("%s is invalid, options are A, B, C, D")
    
    if not motor.connected:
        log.error("%s is not connected" % motor)
        sys.exit(1)
    
    if args.degrees:
        log.info("Motor %s, current position %d, move to position %d, max speed %d" %
                 (args.motor, motor.position, args.degrees, motor.max_speed))
        motor.run_to_rel_pos(speed_sp=args.speed,
                             position_sp=args.degrees,
                             stop_action='hold')
    robot@ev3alt[utils]# 
    
  19. WasabiFan commented on Sep 9, 2017

    @WasabiFan
    Member

    @dwalton76 hmm... I would expect it to "just work". Can you delete all of the node_modules directories and re-try?

    On the topic of running commands, you should run npm from the autogen directory; when you run the actual autogen script, however, you want to run it from the directory with the autogen-spec.json, which is in the root of this repo.

    If the above suggestion doesn't work, please open an issue at the ev3dev-lang repo and we can troubleshoot over there.

  20. dwalton76 commented on Sep 9, 2017

    @dwalton76
    Collaborator
  21. ddemidov commented on Sep 10, 2017

    @ddemidov
    Member

    Another breaking change in stretch is that input device name for buttons has been changed: ev3dev/ev3dev#957

  22. ddemidov commented on Sep 11, 2017

    @ddemidov
    Member

    @dlech, what is debian policy re version numbers? Is it possible to have same versions of a package both in jessie and stretch? Or do we keep 1.0.* for jessie and start with 1.2 for stretch?

    It looks like we could treat jessie and stretch as separate platforms in ev3dev/ev3dev-lang.

  23. dlech commented on Sep 11, 2017

    @dlech
    MemberAuthor

    You cannot upload two packages with the same version. It will cause an error.

    What I have done for other ev3dev packages is add a jessieX suffix if I needed to upload another version to jessie after branching off for stretch. So, if 1.0.0 is the last version in jessie before branching off to stretch, then if there is some criticial fix that needs to be uploaded to jessie, you can name the version 1.0.0jessie1. In stretch, you can continue with the normal version scheme of 1.0.1.

  24. dwalton76 commented on Sep 16, 2017

    @dwalton76
    Collaborator

    I have PRs out for the buttons and LEDs, I am not seeing any issues with port names though so I haven't changed anything there. Motors work and touch sensors work (with and without specifying a port)...not sure what else to try or what should be breaking.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions