2 Replies Latest reply on Oct 20, 2014 11:47 AM by KurtE

    Some general Edison linux questions

    KurtE

      Not sure if best to ask as separate posts or a combined as one..  Depends on different boards.  But with each linux box I fiddle with there are some differences...

       

      shell scripts

      ----

      With Yocto I think it is using ash for the shell.  Are there defined shell start up scripts that I should setup things in.  I am so far using:

      .profile in the root of the home directory where I for example export OSTYPE=Edison

      For use in my makefiles to detect I am building for Edison.

       

      On some other linux boxes I have a start up script (.bashrc ?) where it detects for example that the directory $HOME/bin exists and adds it to $PATH.  is there a suggested way to do this here? 

       

      udev rules

      ----

      Are udev rules working here.  I often setup my code to work off predefined device names like: /dev/ttyXBEE which is setup to point to which actual device I am using.  On some boards, this may be to an XBee connected to some FTDI board.  For these devices, I use udev rules to create the device as if you have multiple FTDI devices sometimes your device might be /dev/ttyUSB0 and the next time it might be /dev/ttyUSB1

       

      Note: I keep notes on how I do things like this in my readme.md project that is part of my github project: www.github.com/kurte/Raspberry_Pi

       

      So on those machines I might create a file in the /etc/udev/rules.d directory, example from an RPI looks something like:  99-usb-serial.rules

      ```

          SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="A800fclo", SYMLINK+="ttyXBEE"
          SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="A4014UWE", SYMLINK+="ttySSC-32"

      ```

       

      On the Beaglebone Black, I was able to setup some rules to use the hardware USARTS, actually two different ways:

          SUBSYSTEM=="tty", ATTRS{port}=="0x0", ATTRS{line}=="1", SYMLINK+="ttyXBEE"

      or

          SUBSYSTEM=="tty", KERNEL=="ttyO1", SYMLINK+="ttyXBEE"

       

      So far on Edison, have not found a combination that works for the /dev/ttyMFD1  suggestions?

       

      users

      ----

      So far I have done everything as user root.  Do most people work this way with edison, or do you normally create a different user?

       

      shutdown

      ----

      Is there a preferred way to shutdown the Edison?  With Arduino boards, you simply unplug (turn off switch).  On some linux boxes I have had issues where maybe things got corrupted on SD card and I had to reimage... So is it suggested that we use some command like: shutdown or halt?

       

      Probably more questions later.

      Thanks

        • 1. Re: Some general Edison linux questions
          mhahn

          settings: for global settings you may use /etc/profile

           

          udev: did you try udevadm to check what is been triggered when you plug in e.g. /dev/tty*?

           

          root: for security reasons you should rather not run everything as root when putting the device in production I'd say.

           

          shutdown: "shutdown now" should be the preferred way to cleanly shutdown the system

          1 of 1 people found this helpful
          • 2. Re: Some general Edison linux questions
            KurtE

            Thanks,

             

            I will probably use the /etc/profile file to add stuff to path like cmake.

             

            Yes I use udevadm to look at things and to do a reload and the like, but so far I have not figured at a trigger that works for a built in hardware device like the actual UART that works.  Took me awhile on the Beaglebone black as well.

             

            So far my playing is just for myself, but hopefully at some point will be playing more with some other people at Trossen Robotics ...

             

            Yes I prefer to do things like shutdown now, but was wondering about what others do when they use these like an Arduino with sketches and don't have a Putty or Terminal connection to it.

             

            Thanks again