0
Unable to upload program with Scilab Arduino Toolbox

While working with the Arduino-Scilab toolbox, same issue come up everytime.
Serial port does not close properly and I am unable to upload any program.

After that when I try to upload some Arduino sketch, following error message comes:

Arduino: 1.6.5 (Windows 7), Board: "Arduino Uno"

Sketch uses 12,446 bytes (38%) of program storage space. Maximum is 32,256 bytes.

Global variables use 348 bytes (16%) of dynamic memory, leaving 1,700 bytes for local variables. Maximum is 2,048 bytes.

avrdude: ser_open(): can't open device "\\\\.\\COM2": Access is denied.




Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

  This report would have more information with
  "Show verbose output during compilation"
  enabled in File > Preferences.

I have very limited knowledge on handling blocked serial ports, and unable to search any solution on Google.

Please guide.


Scilab-Arduino 26-07-15, 2:22 p.m. Navdeep

Answers:

0

If serial ports are n't closed properly in scilab-arduino toolbox, then run the the below program :

ok=open_serial(1,2,115200)\r\n
if ok~=0 then\r\n
    error(['Unable to open serial port' ; 'Please reload the firmware and restart'; '']);\r\n
else close_serial(1);\r\n
    disp('Serial port seems to be working');\r\n
end;

I think you are trying to use scilab-arduino toolbox based experiments and some independent arduino sketches simultaneously.
It will be good either you use firmware for the toolbox first, perform some particular experiments and then use your independent arduino sketches or vice-versa.



28-07-15, 10:59 a.m. manas

\r\n\r\n

Thank you for your quick reply Sir.

\r\n\r\n

But the solution you suggested did not work, and moreover\r\nlogically I don\u2019t feel it right.

\r\n\r\n

Take an e.g. suppose there are 2 reservoirs (1st\r\nour laptop system and 2nd Arduino hardware) connected by a pipeline\r\n(here serial bus) controlled by certain gates (here Comports). Now if the\r\npipeline is blocked anyhow, bi-directional flow (date flow) through it stops.

\r\n\r\n

To maintain the continuous functioning of this pipeline we need\r\nsome better solution.

\r\n\r\n

The program you provided cannot pass through.

\r\n\r\n


29-07-15, 1:14 p.m. Navdeep

Login to add comment


0

\r\n\r\n

There are 2 sides of this problem:

\r\n\r\n

1.      \r\nBeginning of the problem:

\r\n\r\n

If some error is in the .sce file which is\r\nrun, then the mentioned problem comes.

\r\n\r\n

I feel there is some issue with the firmware.

\r\n\r\n

 Size of the program affects the execution time\r\n(directly proportional).  

\r\n\r\n

2.      \r\nQuick Mitigation

\r\n\r\n

Unplug Arduino from the system. Close all\r\nthe programs both Scilab and Arduino environment. And start fresh.

\r\n\r\n

This idea is not good if the Arduino is used\r\nin some project remotely installed and working independently.

\r\n\r\n

Please enlighten.

\r\n\r\n

29-07-15, 1:16 p.m. Navdeep


0


Dear Navdeep,
The problem occurs only if the serial port isn't closed properly from scilab part and not from the arduino part.
And this issue occurs if you forcefully closes any program during the simulation.As far as my knowledge,there is no such issue from the firmware part.Anyway, i will go through it and let you know.But, it will be good if you also can find if any such bug exists in the firmware.

I didn't suggest you to perform toolbox related experiments and pure arduino experiments independently on different boards.First you perform all the related set of experiments either to toolbox or pure arduino sketches then other set of experiments. 

Thanks,

30-07-15, 4:14 p.m. manas


0


Dear Navdeep,
The problem occurs only if the serial port isn't closed properly from scilab part and not from the arduino part.
And this issue occurs if you forcefully closes any program during the simulation.As far as my knowledge,there is no such issue from the firmware part.Anyway, i will go through it and let you know.But, it will be good if you also can find if any such bug exists in the firmware.

I didn't suggest you to perform toolbox related experiments and pure arduino experiments independently on different boards.First you perform all the related set of experiments either to toolbox or pure arduino sketches then other set of experiments. 

Thanks,

30-07-15, 4:15 p.m. manas


0

Hi Navdeep,


 "While working with the Arduino-Scilab toolbox, same issue come up everytime.
Serial port does not close properly and I am unable to upload any program."
--- I think Arduino-Scilab toolbox is developed so that you need not 'Upload any program' in Arduino.

Also as manas correctly said, serial port is not closed from scilab side(i.e. your computer machine/laptop). When we have any error in .sce file while working with scilab-arduino toolbox, code terminates in between so the close_serial (1) does not get executed. It happens quite a lot especially when you are learning new experiments. 

If one wants full-proof solution, we need to perform close_serial(1) every time scilab code terminates (because of whatever reason). 
So we need to catch the event of termination and run our function which has close_serial(1) written. I will post if it works. 

For the temporary solution we can perform following troubleshooting 
1. use command abort and close_serial(1)
2. remove and re-plug USB cable in laptop
3. reset Arduino

04-08-15, 3:15 p.m. samruddh


0

Hello Manas and Samruddh

Thanks a lot for taking interest in this issue.
The problem is clearly defined now and so it is easy to work in some direction with it.
I am also working upon it and soon revert back if something comes up.

Thanks and Regards

06-08-15, 5:27 p.m. Navdeep


Log-in to answer to this question.