9 Replies Latest reply on Apr 7, 2016 6:48 PM by Itstechpro

    problem runnin Edison Arduino simplewebserver sketch

    Itstechpro

      during upload, receive this error:

      cluploadEdison_win.sh: line 56: /dev/ttyS6: Permission denied

       

      I checked to verify that both Edison user names are included in the dialout group.

       

      Any suggestions would be appreciated.

       

      JM

        • 1. Re: problem runnin Edison Arduino simplewebserver sketch
          Intel Corporation
          This message was posted on behalf of Intel Corporation

          Hi JM,

          I would like to know more information about the configuration you are using:
          1.    Which OS are you using on your PC?
          2.    Which image version is on the board?
          3.    Which Arduino IDE are you using?
          4.    Could you attach the full error log that appears on the IDE?

          Also, regarding the usernames on the Edison. How are you setting this? Are you setting different users on the PC or in the Edison?

          Regards,
          Charlie
           

          • 2. Re: problem runnin Edison Arduino simplewebserver sketch
            Itstechpro

            OS is Win7 pro 64 bit

            The last version I loaded was 25.5-15 after which I loaded a patch by B.Brotherton (LGSInnovations/edison-bbcharge-patch · GitHub) that enabled setting of the RTC battery charging parameters.  That was after a conversation with you regarding an upcoming new version that would accomplish the same thing.

            When I cat/etc/version, I find:

            custom_build_azureuser@20150821163131

            Arduino IDE is 1.6.7

            I'll have to run the upload again and capture the log

            Thanks,

            Jules

            • 3. Re: problem runnin Edison Arduino simplewebserver sketch
              Itstechpro

              Whoops ... forgot your question on usernames ....

              set on Edison, I was using  "root"

              • 4. Re: problem runnin Edison Arduino simplewebserver sketch
                Itstechpro

                Here is the complete upload dialogue:

                Arduino: 1.6.7 (Windows 7), Board: "Intel® Edison"

                 

                Sketch uses 94,152 bytes (0%) of program storage space. Maximum is 10,000,000 bytes.

                C:\Users\Julius\AppData\Local\Arduino15\packages\Intel\tools\sketchUploader\1.6.2+1.0/x86/bin/bash.exe --verbose --noprofile C:\Users\Julius\AppData\Local\Arduino15\packages\Intel\tools\sketchUploader\1.6.2+1.0/clupload/cluploadEdison_win.sh C:\Users\Julius\AppData\Local\Arduino15\packages\Intel\tools\sketchUploader\1.6.2+1.0/x86/bin C:\Users\Julius\AppData\Local\Temp\buildb610943d6424eeb3e8aff919438b7c73.tmp/SimpleWebServerWiFi.ino.elf COM7

                #!/bin/sh

                starting download script

                 

                # clupload script to invoke lsz

                # Copyright (C) 2014 Intel Corporation

                Args to shell: C:\Users\Julius\AppData\Local\Arduino15\packages\Intel\tools\sketchUploader\1.6.2+1.0/x86/bin C:\Users\Julius\AppData\Local\Temp\buildb610943d6424eeb3e8aff919438b7c73.tmp/SimpleWebServerWiFi.ino.elf COM7

                #

                # This library is free software; you can redistribute it and/or

                # modify it under the terms of the GNU Lesser General Public

                # License as published by the Free Software Foundation; either

                # version 2.1 of the License, or (at your option) any later version.

                COM PORT 7

                #

                # This library is distributed in the hope that it will be useful,

                Converted COM Port COM7 to tty port /dev/ttyS6

                # but WITHOUT ANY WARRANTY; without even the implied warranty of

                Sending Command String to move to download if not already in download mode

                # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU

                # Lesser General Public License for more details.

                #

                # You should have received a copy of the GNU Lesser General Public

                # License along with this library; if not, write to the Free Software

                # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

                #

                 

                echo "starting download script"

                echo "Args to shell:" $*

                 

                # ARG 1: Path to lsz executable.

                # ARG 2: Elf File to download

                # ARG 3: COM port to use.

                 

                #path contains \ need to change all to /

                path_to_exe=$1

                Deleting existing sketch on target

                fixed_path=${path_to_exe//\\/\/}

                 

                #COM ports are not always setup to be addressed via COM for redirect.

                #/dev/ttySx are present. Howwever, COMy -> /dev/ttySx where x = y - 1

                 

                com_port_arg=$3

                com_port_id=${com_port_arg/COM/}

                echo "COM PORT" $com_port_id

                tty_port_id=/dev/ttyS$((com_port_id-1))

                echo "Converted COM Port" $com_port_arg "to tty port" $tty_port_id

                 

                echo "Sending Command String to move to download if not already in download mode"

                echo "~sketch downloadEdison" > $tty_port_id

                C:\Users\Julius\AppData\Local\Arduino15\packages\Intel\tools\sketchUploader\1.6.2+1.0/clupload/cluploadEdison_win.sh: line 42: /dev/ttyS6: Permission denied

                 

                #Move the existing sketch on target.

                echo "Deleting existing sketch on target"

                "$fixed_path/lsz.exe" --escape -c "mv -f /sketch/sketch.elf /sketch/sketch.elf.old" <> $tty_port_id 1>&0

                C:\Users\Julius\AppData\Local\Arduino15\packages\Intel\tools\sketchUploader\1.6.2+1.0/clupload/cluploadEdison_win.sh: line 46: /dev/ttyS6: Permission denied

                # Execute the target download command

                 

                #Download the file.

                host_file_name=$2

                "$fixed_path/lsz.exe" --escape --binary --overwrite $host_file_name <> $tty_port_id 1>&0

                C:\Users\Julius\AppData\Local\Arduino15\packages\Intel\tools\sketchUploader\1.6.2+1.0/clupload/cluploadEdison_win.sh: line 51: /dev/ttyS6: Permission denied

                 

                #mv the downloaded file to /sketch/sketch.elf

                target_download_name="${host_file_name##*/}"

                echo "Moving downloaded file to /sketch/sketch.elf on target"

                Moving downloaded file to /sketch/sketch.elf on target

                "$fixed_path/lsz.exe" --escape -c "mv $target_download_name /sketch/sketch.elf; chmod +x /sketch/sketch.elf" <> $tty_port_id 1>&0

                C:\Users\Julius\AppData\Local\Arduino15\packages\Intel\tools\sketchUploader\1.6.2+1.0/clupload/cluploadEdison_win.sh: line 56: /dev/ttyS6: Permission denied

                • 5. Re: problem runnin Edison Arduino simplewebserver sketch
                  Itstechpro

                  Dear Charlie,

                  Seems I was using the wrong Edison port for the Arduino upload.  Switched to Intel Edison Virtual Com Port and sketch uploaded.  The remaining problem is that the program wants to see a wpa/wpa2 network and my access point only uses WEP.   The line:

                   

                  // Connect to WPA/WPA2 network. Change this line if using open or WEP network:   

                      status = WiFi.begin(ssid, pass);

                  in the sketch indicates a WEP or open network requires an edit, but I'm not sure how to do that.

                  Thanks,

                  Jules

                  • 6. Re: problem runnin Edison Arduino simplewebserver sketch
                    Intel Corporation
                    This message was posted on behalf of Intel Corporation

                    Hi Jules,

                    I’m glad to know that you were able to upload the sketch.
                    Regarding using the Arduino sketch with a WEP network, try the following: 
                    status = WiFi.begin(ssid, keyIndex, key);
                    or
                    status = WiFi.begin(ssid);
                    Check some  examples for these networks in the following links:
                    https://www.arduino.cc/en/Tutorial/ConnectWithWEP
                    https://www.arduino.cc/en/Guide/ArduinoWiFiShield

                    Regards,
                    Charlie

                    • 7. Re: problem runnin Edison Arduino simplewebserver sketch
                      Itstechpro

                      Charlie,

                      I think we're getting closer.  Made the changes to the code for a WEP network and successfully connected but when my browser (Mozilla) connects to the server at the advertised ip address, all I get is the Intel Device Information screen.  The HTML code doesn't appear to do much except create and populate three text regions.  No on and off buttons as advertised in the sketch ...

                      I don't see a mechanism for the client to control anything on the host ???

                      Thanks,

                      Jules

                      see screen shot below

                      simple.jpg

                      • 8. Re: problem runnin Edison Arduino simplewebserver sketch
                        Intel Corporation
                        This message was posted on behalf of Intel Corporation

                        Hi Jules,

                        On the Arduino sketch change the line
                        WiFiServer server(80);
                        for 
                        WiFiServer server(81);

                        Once it is uploaded, go to the browser and type 192.168.1.71:81 

                        Let me know if it works.
                        Regards,

                        Charlie
                         

                        • 9. Re: problem runnin Edison Arduino simplewebserver sketch
                          Itstechpro

                          Dear Charlie,

                          That did it. Didn't think to try changing the port number.  I listed the 'well known ports' and tried a couple of other open ones and, as expected, it also worked. When I use the 'inspector' function in Firefox now, I see the HTML script contained in the server definition in the sketch.

                           

                          Have to look through the Edison files sometime to find out where the HTML script for the Device Information page sits.

                           

                          Now I can go ahead and develop the server page for the remote sensing and control application I'm working on.

                          Many thanks,

                          Jules