Posting here so the solution can be found:
Close the serial monitor on the Arduino IDE
As long as its open Coppelia won't comunicate via serial.
If you need to see what serial data is being passed in between the microcontroler and the simulation like I do, use something like Serial Port Monitor.
Search found 4 matches
- 08 Aug 2024, 23:08
- Forum: General questions
- Topic: sim.serialOpen returns -1
- Replies: 8
- Views: 2261
- 01 Aug 2024, 20:34
- Forum: General questions
- Topic: sim.serialOpen returns -1
- Replies: 8
- Views: 2261
Re: sim.serialOpen returns -1
I found my solution luckily. The problem for me is that I ran the Coppelia Sim script with the Arduino IDE serial monitor opening. So the port was detected as "is using". Please make sure that the port you selected in Coppelia Sim is not using in other software. That was my guess, but the...
- 29 Jul 2024, 19:31
- Forum: General questions
- Topic: sim.serialOpen returns -1
- Replies: 8
- Views: 2261
Re: sim.serialOpen returns -1
Yes, I am running on Windows.
- 19 Jul 2024, 19:23
- Forum: General questions
- Topic: sim.serialOpen returns -1
- Replies: 8
- Views: 2261
sim.serialOpen returns -1
My goal is to use serial communication between CoppeliaSim and Arduino to manipulate simulation elements through sensors read by the Arduino. port = "\\\\.\\COM4" function sysCall_init() sim = require('sim') serialHandle = sim.serialOpen(port, 9600) print(serialHandle) pivot = sim.getObjec...