Comments (27)
Hi! Thanks for opening this issue. I noticed this recently when I was testing with a Micro. If you run the code again immediately after it fails the first time, it does work for me. This is obviously a bug, so this gives me a hint on where to took to start tracking it down with a fix. Thanks and I'll leave this open until I find a solution, which hopefully should be quite soon 😁
from avrgirl-arduino.
gotcha. Yeah I'd say the long bootloader time on the Micro will not allow an immediate reattempt. I'll look into this further asap, I'm sure it's solvable as it's only a recently introduced bug. More soon!
from avrgirl-arduino.
Yay a workaround! TY I was worried I would have to mess with serial npm packages again 😨
from avrgirl-arduino.
My aim is for folks to never have to do this stuff manually themselves starting from scratch 😄
If you can run the flash
method again upon the first error as a workaround for now, I'll update you when the bug is fixed. I appreciate your kindness and am happy you're getting use out of avrgirl-arduino 🙆
from avrgirl-arduino.
No dice in my testing....
it finds the micro, resets, and fails, but when rerun immediately after it either:
- resets the board again
- gives "Error: opening COM12: File not found();"
- gives "Error: no Arduino 'micro' found"
- gives "Error: Opening COM12: Access denied(...)"
the error depends on when in the process i have it re-run the flash command, help please :(
from avrgirl-arduino.
Ok so more testing.... I got it to flash, using the 'leonardo' board and manually forcing the correct com port...
var avrgirl = new Avrgirl({
board: 'leonardo',
port: 'COM12',
// turn on debug mode!
debug: true
});
Hopefully this makes the fix easier knowing it reboots/flashes fine using whatever you set for leonardo? Maybe just use the same for micro?
from avrgirl-arduino.
oh, odd! I have a feeling I might know what it going on. This has been super helpful from you, thank you!! Lemme do a bunch of tests on windows and report back.
from avrgirl-arduino.
Couple of questions, as I cannot replicate this on my mac or my windows box:
- is your Arduino Micro from Arduino, or is it a clone? It should look like one of these
- Does the script work at all if you specify the port, but leave it as
micro
being the board type? - If you answer is 'no' to the second question, could you please run the following with your Arduino plugged in, and paste the results in this thread?
var Avrgirl = require('avrgirl-arduino');
var avrgirl = new Avrgirl({
board: 'micro',
debug: true
});
var hex = 'path/to/your/hex/file.hex';
avrgirl.list(function(err, ports) {
console.log('1st list', ports);
});
avrgirl.flash(hex, function(error) {
console.log(error);
avrgirl.list(function(e, ports) {
console.log('2nd list', ports);
});
});
from avrgirl-arduino.
Me again - I just published what I think should be a fix for this bug, if you npm install avrgirl-arduino@latest
could you please let me know if you see it fixed on your end too?
Thanks!
from avrgirl-arduino.
No dice, to answer your questions:
- this is a clone board, arduino pro micro
- same error
Navigated to file:///C:/Users/Mike/Documents/GitHub/CoreIR-Uplink/source/index.html
C:\Users\Mike\Documents\GitHub\CoreIR-Uplink\source\node_modules\avrgirl-arduino\lib\connection.js:25 found micro on port COM11
C:\Users\Mike\Documents\GitHub\CoreIR-Uplink\source\node_modules\avrgirl-arduino\lib\avr109.js:114 resetting board...
1st list [Object, Object]
0: Object_standard
Pid: "0x8037"
comName: "COM11"
locationId: undefined
manufacturer: "Arduino LLC (www.arduino.cc)"
pnpId: "USB\VID_2341&PID_8037&MI_00\7&179A8F7E&0&0000"
productId: undefined
serialNumber: undefined
vendorId: undefined
__proto__: Object
_nullcaller: nulllength: 1name: "set __proto__"__proto__: ()<function scope>1: Object_standardPid: ""comName: "COM1"locationId: undefinedmanufacturer: "(Standard port types)"pnpId: "ACPI\PNP0501\1"productId: undefinedserialNumber: undefinedvendorId: undefined__proto__: Objectlength: 2__proto__: Array[0]
[Object, Object]
0: Object_standard
Pid: "0x8037"
comName: "COM11"
locationId: undefined
manufacturer: "Arduino LLC (www.arduino.cc)"
pnpId: "USB\VID_2341&PID_8037&MI_00\7&179A8F7E&0&0000"
productId: undefined
serialNumber: undefined
vendorId: undefined
__proto__: Object1: Object_standard
Pid: ""
comName: "COM1"
locationId: undefined
manufacturer: "(Standard port types)"
index.html:101 Error: could not reconnect after resetting board.(…)
2nd list [Object, Object]
0: Object
_standardPid: ""
comName: "COM1"
locationId: undefined
manufacturer: "(Standard port types)"
pnpId: "ACPI\PNP0501\1"
productId: undefined
serialNumber: undefined
vendorId: undefined
__proto__: Object
1: Object
_standardPid: "0x0036"
comName: "COM10"
locationId: undefined
manufacturer: "Arduino LLC (www.arduino.cc)"
pnpId: "USB\VID_2341&PID_0036\6&32FB597E&0&1"
productId: undefined
serialNumber: undefined
vendorId: undefined
__proto__: Object
length: 2
__proto__: Array[0]
from avrgirl-arduino.
out of curiosity - are you using this in a browser, Electron, or Chrome app perhaps? Trying to narrow this down. I've been testing in a nodejs terminal context, so I fear I've been testing this incorrectly the whole time
from avrgirl-arduino.
https://github.com/slacker87/CoreIR-Uplink
Electron, like I said, works great with leonardo selected! Who knows why :p
from avrgirl-arduino.
it seems that the problem is that the clone reports a non standard (ie. not a genuine Arduino) product id when in bootloader mode. Clones can be really tricky, and I can't always guarantee support for them out of the box as they widely vary with how they present as a device on USB.
I added that product id to the micro identification object and published it - could you possible retry again? Thanks!
from avrgirl-arduino.
Success on three different type of 32u4 clone boards! 🎉
Now when I code up and share my project I can safely know they'll work first try with avrgirl 🎂 ty
from avrgirl-arduino.
🙌 🙌 🙌 🙌
great to have another clone out in the wild tracked down and now compatible. Thanks for your patience! 🎉
from avrgirl-arduino.
I'm getting the same "File not found" error, same as slacker87's first comment. Checked my product ID (productID: '8037') and it seemed okay although it is a clone micro. I then used the code you supplied on August 26 and here is the result:
1st list [ { comName: 'COM7',
manufacturer: 'Arduino LLC (www.arduino.cc)',
serialNumber: undefined,
pnpId: 'USB\VID_2341&PID_8037&MI_00\8&306F1381&0&0000',
locationId: '0000.001a.0000.001.001.004.000.000.000',
vendorId: '2341',
productId: '8037',
_standardPid: '8037' } ]
found micro on port COM7
resetting board...
Error: Opening COM7: File not found
at Error (native)
2nd list [ { comName: 'COM7',
manufacturer: 'Arduino LLC (www.arduino.cc)',
serialNumber: undefined,
pnpId: 'USB\VID_2341&PID_8037&MI_00\8&306F1381&0&0000',
locationId: '0000.001a.0000.001.001.004.000.000.000',
vendorId: '2341',
productId: '8037',
_standardPid: '8037' } ]
Help Please and Thank you!
from avrgirl-arduino.
hmmm might be a timing issue 🤔 I'll try this on Windows when I get a chance to see if I can replicate.
from avrgirl-arduino.
Could you check the PID in bootloader mode? Just double tap the reset button and run the list command again. It might be missing for the PID list.
from avrgirl-arduino.
I reset the board twice ( there is no reset button so I jumped the GND and RST twice) and the results are the same:
No port auto sniff
1st list [ { comName: 'COM7',
manufacturer: 'Arduino LLC (www.arduino.cc)',
serialNumber: undefined,
pnpId: 'USB\VID_2341&PID_8037&MI_00\8&306F1381&0&0000',
locationId: '0000.001a.0000.001.001.004.000.000.000',
vendorId: '2341',
productId: '8037',
_standardPid: '8037' } ]
found micro on port COM7
resetting board...
After that it just hangs. :(
from avrgirl-arduino.
from avrgirl-arduino.
No luck with 'leonardo':
No port auto sniff
1st list [ { comName: 'COM7',
manufacturer: 'Arduino LLC (www.arduino.cc)',
serialNumber: undefined,
pnpId: 'USB\VID_2341&PID_8037&MI_00\8&306F1381&0&0000',
locationId: '0000.001a.0000.001.001.004.000.000.000',
vendorId: '2341',
productId: '8037',
_standardPid: '8037' } ]
Error: no Arduino 'leonardo' found.
at C:\Users\ts-ycc\node_modules\avrgirl-arduino\lib\connection.js:33:
25
at C:\Users\ts-ycc\node_modules\avrgirl-arduino\lib\connection.js:74:
12
at C:\Users\ts-ycc\node_modules\avrgirl-arduino\lib\connection.js:212
:12
2nd list [ { comName: 'COM7',
manufacturer: 'Arduino LLC (www.arduino.cc)',
serialNumber: undefined,
pnpId: 'USB\VID_2341&PID_8037&MI_00\8&306F1381&0&0000',
locationId: '0000.001a.0000.001.001.004.000.000.000',
vendorId: '2341',
productId: '8037',
_standardPid: '8037' } ]
from avrgirl-arduino.
Thanks for posting all of the debug info 😄
I'm currently traveling until later this week so I don't have my gear on me to try to reproduce 😞 I'll keep you posted!
from avrgirl-arduino.
@ts-ycc hi there, I could not reproduce this because it turns out I don't have an Arduino Pro Micro. I have an Arduino Micro, which is quite different.
You said your board is an Arduino Pro Micro. If so, Avrgirl Arduino does not currently support this exact board yet. It has a slightly different bootloader, and is not the same as an Arduino Micro.
Does your board seem to be something like this? https://www.sparkfun.com/products/12640
Let me know, and if you're not sure feel free to attach a photo of your board to a reply 😄
from avrgirl-arduino.
Yes, indeed I have an Arduino Pro Micro. Oh well. :( Thanks for the info, though. Also, one thing I noticed is that the USB/serial driver (by Auduino) I used did not send an event when the board was reset and that might be the reason why the software hangs after it tried to reset the board.
from avrgirl-arduino.
ah I see. Could you try something for me? I wonder if you need the 'double reset' due to the slightly different bootloader. See this that I found: https://cdn.sparkfun.com/datasheets/Dev/Arduino/Boards/32U4Note.pdf
if you were already resetting the board twice I apologise. I think there also might be a different flashing method as well, but I can ready the datasheet of the board and see if I can support this board with minimal effort.
from avrgirl-arduino.
I tried the double reset but it did not work, then I uninstall the current Arduino driver and reinstall another USB Serial driver and voila it works!!! The only thing I am not quite sure is the board does not blink and I used blink.cpp.hex to flash it. Here is the output:
No port auto sniff
1st list [ { comName: 'COM6',
manufacturer: 'Arduino LLC (www.arduino.cc)',
serialNumber: undefined,
pnpId: 'USB\VID_2341&PID_8037&MI_00\7&14380AD2&0&0000',
locationId: '0000.001d.0000.001.001.000.000.000.000',
vendorId: '2341',
productId: '8037',
standardPid: '8037' } ]
found micro on port COM6
resetting board...
reset complete.
connected
flashing, please wait...
flash complete.
null
2nd list [ { comName: 'COM7',
manufacturer: 'Arduino LLC (www.arduino.cc)',
serialNumber: undefined,
pnpId: 'USB\VID_2341&PID_0036\6&796A6A0&0&1',
locationId: 'Port#1.Hub_#0003',
vendorId: '2341',
productId: '0036',
_standardPid: '0036' } ]
Looks good!! So the reason it did not work is because of the driver, but why the Arduino IDE works with the same driver is a bit puzzling. Also, you may want to add a timeout after the board is reset so for whatever reasons the driver does not respond the software will not hang. Thanks!
from avrgirl-arduino.
Glad you got it to work! Weird.
I do have a timeout in the code for after a reset, so I wonder if there's something I need to catch before the reset completes. Thanks
from avrgirl-arduino.
Related Issues (20)
- An in-range update of minimist is breaking the build 🚨 HOT 1
- Program not exiting flash function after successfully uploading hex file HOT 6
- Problem with webserial demo example HOT 2
- After running firmata-party yun --debug it cant find a file under /junk/hex HOT 3
- [Feature Request] Allow reading and writing to EEPROM HOT 4
- Flashing stalls at "connected" HOT 6
- flashing avr109 in browser HOT 16
- Can't run `lint` script on Windows
- Can't run `tape` script on Windows
- migrate from travis ci to github actions HOT 1
- set up auto generation of release changelogs
- With navigator.Serial will it be possible to support the nano-range?
- Uncaught (in promise) TypeError: Cannot read property 'filter' of undefined
- React Demo build error with module imports
- SAM-D2x Support HOT 4
- Error: Something went wrong with the API request: Error: certificate has expired
- Console outputs cryptic signs with CLI HOT 1
- Support for Web Bluetooth API?
- Is it possible to add ATmega4809 support?
- flash() callback triggered before connection.serialPort is confirmed closed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from avrgirl-arduino.