Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to solve Issue #26 (Motes change names while programming) #28

Merged
merged 2 commits into from
Nov 11, 2014

Conversation

comawill
Copy link

This PR solves #26 in different ways

  1. introducing a udev-rule which generates systemlinks for nodes at /dev/inga/node-* and uses them instead of ttyUSB* (no more automatic renaming)
  2. introducing a way to get static handles for the ttyUSB* by using /dev/serial/by-id/* for setups without this udev-rule
  3. fallback mode to ttyUSB* if all of them fail

@ibr-jenkins
Copy link

Can one of the admins verify this patch?

motes = glob.glob("/dev/serial/by-id/*IBR_INGA*")

if not motes:
motes = glob.glob("/dev/USB*")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you have to glob here on "/dev/ttyUSB*"

@yschroeder
Copy link

I will test this tomorrow.

@comawill
Copy link
Author

@yschroeder thank you (fixed that typo)

@yschroeder
Copy link

We should think about how specific the udev rule should be:

In the current version we map all FTDI devices to the INGA folder. This comes in handy for motes where the initial setup wasn't done (yet). But maybe it is better to only map devices into that folder that have

ATTRS{product}=="INGA"

set.

This can prevent confusion if multiple different FTDI devices are connected. Every INGA is an FTDI but not every FTDI is an INGA 😄

@yschroeder
Copy link

I just tested this (without parallel execution as PR #27 was missing).

For me it works by getting the nodes from the /dev/inga folder. I have not tested the fallback paths.

Maybe we should glob onto /dev/inga/* instead of /dev/inga/node-*, this way it would also work for @ejoerns udev rule where the nodes have different names.

But after all: 👍

@comawill
Copy link
Author

Changed those things:

  1. only symlinks for INGA devices
  2. no mode modifications
  3. changed first glob to /dev/inga/* (if there is a need to be more specific, this could be changed in the future, too)

@ejoerns ejoerns self-assigned this Nov 11, 2014
@ejoerns
Copy link

ejoerns commented Nov 11, 2014

👍 looks great!

I'm not sure if platform is the right place for the udev rules or if we should place it in examples or tools. But a more important further step would be to add a hint to use it somewhere in the documentation; either in the Wiki, in a README.md or the Doxygen page, or simply everywhere ;) But this is a more general issue and does not have to be covered by this PR.

ejoerns pushed a commit that referenced this pull request Nov 11, 2014
Attempt to solve Issue #26 (Motes change names while programming)
@ejoerns ejoerns merged commit 94259a1 into ibr-cm:develop Nov 11, 2014
@comawill comawill deleted the pull-req/fix26 branch November 12, 2014 12:38
gvz pushed a commit to gvz/contiki-inga that referenced this pull request Jul 15, 2016
Attempt to solve Issue ibr-cm#26 (Motes change names while programming)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants