SolidSoils / Arduino

C# .NET - Arduino library supporting simultaneous serial ASCII, Firmata and I2C communication
https://solidsoils.github.io/Arduino/index.html
BSD 2-Clause "Simplified" License
200 stars 61 forks source link

Restart arduino #19

Closed facetime88 closed 6 years ago

facetime88 commented 6 years ago

When app start running, the app cannot communicate with arduino, cannot send message neither receive any message. But when the app still running and arduino is reset manually, the app start to receiving message.

In arduino IDE, when we start serial monitor, this will restart arduino. But this not happen in this case. How do I restart arduino everytime the app is running?

facetime88 commented 6 years ago

I am using arduino due anyway

facetime88 commented 6 years ago

It seems the default value when app running for base.DtrEnable is set to false. I add base.DtrEnable = true; before base.Open(), and everytime app is starting, the arduino will also restarted.

I propose you also add DtrEnable as public property in EnhancedSerialConnection. Thank you

SolidSoils commented 6 years ago

EnhancedSerialConnection is a subclass of SerialPort. Therefore there is no need to add property DtrEnable. You can use it like this:

var connection = new EnhancedSerialConnection("COM3", SerialBaudRate.Bps_57600);
connection.DtrEnable = true;
var session = new ArduinoSession(connection);
facetime88 commented 6 years ago

It said 'DtrEnable' is not a member of ISerialConnection.

anyway...Merry Christmas & Happy New Year 2018....!