EV (Customer) asked a question.

P1AM quit uploading

I was able to install the Arduino IDE, add libraries, create programs controlling both base I/O's and third party shields. Then one day uploading quit working. I get following:

 

Error opening serial port '/dev/ttyACM0'. (Port not found)

 

 

Interestingly I am able to retrieve the board info from tools menu.

I am running in the Ubuntu 18 environment.

Any ideas?

 

 


  • ADC Community_02 (Automationdirect.com)

    1. Put the board into bootloader mode by double tapping the reset button quickly. The LED should have a breathing pattern if this was done correctly.
    2. Attempt to upload the blink example to the board. You will likely have to change the COM port to that of the bootloader.

     

  • FACTS_KevinC (AutomationDirect)

    After putting the board into boot loader by pressing can you upload the blink sketch.

    Does this issue occur after uploading the blink example sketch?

     

    If you are able to can you share your code either in forum here or via a private message?

    • EV (Customer)

      Here is the code:

      1. /*
      2. myButton
      3.  
      4. Modified Button. Turns on and off a relay connected to output,
      5. when pressing a pushbutton attached to an input.
      6.  
      7. */
      8.  
      9. #include <P1AM.h>
      10.  
      11. // constants won't change. They're used here to set pin numbers:
      12. const int slotInNo = 1; // the slot # module is in, starting with 1
      13. const int buttonInNo = 1; // the number of the pushbutton pin
      14. const int slotOutNo = 2; // the slot # module is in, starting with 1
      15. const int relayOutNo = 7; // the number of the relay pin
      16.  
      17. // variables will change:
      18. bool buttonState=LOW; // variable for reading the pushbutton status
      19.  
      20.  
      21.  
      22. void setup() {
      23. Serial.begin(115200); //initialize serial communication at 115200 bits per second
      24. while (!P1.init()){
      25. ; //Wait for Modules to Sign on
      26. }
      27. }
      28.  
      29. void loop() {
      30. // read the state of the pushbutton value:
      31. buttonState = P1.readDiscrete(slotInNo,buttonInNo); // Read state of an input
      32.  
      33.  
      34.  
      35.  
      36.  
      37.  
      38. // check if the pushbutton is pressed. If it is, the buttonState is HIGH:
      39. if (buttonState == HIGH) {
      40. // turn relay on:
      41. P1.writeDiscrete(HIGH,slotOutNo,relayOutNo); // Turn on output
      42. } else {
      43. // turn relayOut# off:
      44. P1.writeDiscrete(LOW,slotOutNo,relayOutNo); // Turn off output
      45. }
      46. Serial.println(buttonState); //Print the value to the serial monitor. 1 is on, 0 is off
      47. delay(1000); //Wait one second so it's easier to read the serial output.
      48. }

       

      Expand Post
  • EV (Customer)

    Can you point me to the blink example you have in mind?

    I will be using the IDE and a regular upload to the P1AM, correct?

    Thanks.

    • EV (Customer)

      Thank you for the code. I could not find it in examples.

       

      I attempted to upload it after I put the controller into the bootloader mode, but same thing.

      Here is the error output:

       

      Sketch uses 10072 bytes (3%) of program storage space. Maximum is 262144 bytes.

      Forcing reset using 1200bps open/close on port /dev/ttyACM0

      processing.app.debug.RunnerException

         at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:152)

         at cc.arduino.UploaderUtils.upload(UploaderUtils.java:77)

         at processing.app.SketchController.upload(SketchController.java:732)

         at processing.app.SketchController.exportApplet(SketchController.java:703)

         at processing.app.Editor$UploadHandler.run(Editor.java:2055)

         at java.base/java.lang.Thread.run(Thread.java:834)

      Caused by: processing.app.SerialException: Error touching serial port '/dev/ttyACM0'.

         at processing.app.Serial.touchForCDCReset(Serial.java:107)

         at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:136)

         ... 5 more

      Caused by: jssc.SerialPortException: Port name - /dev/ttyACM0; Method name - openPort(); Exception type - Port not found.

         at jssc.SerialPort.openPort(SerialPort.java:167)

         at processing.app.Serial.touchForCDCReset(Serial.java:101)

         ... 6 more

       

       

      Expand Post
      • FACTS_AdamC (AutomationDirect)

        Are you running ubuntu natively or on a virtual machine?

        Are you running Arduino with sudo privileges?

        What version of the Arduino IDE are you using?

  • EV (Customer)

    I run Ubuntu natively. The arduino is 1.8.13 version and I cannot run it with sudo privileges. I get

    mkdir: cannot create directory '/run/user/0': Permission denied

    when I try.

    Thank you..