MobiFlight-Connector
MobiFlight-Connector copied to clipboard
Support Arduino Nano
Is your feature request related to a problem? Please describe.
It's basically an Uno. We should support the Nano :)
Describe the solution you'd like
Support the Nano
Describe alternatives you've considered
Don't support the Nano
Additional context
Once #553 is done this is trivial.
@neilenns Would you like to add the board definition for the nano?
I was thinking it should wait until after the 2.0 release? To give time for people to test and make sure the firmware actually works
Also I ran into trouble when I was doing this locally because my nano has the same vid and PID as the mega
That's fine. You are right... we can wait with this one until after the release. I have seen this problem before where VID/PID combos are used by mega and uno... which is even more disturbing. A user can now handle that locally by editing the info but maybe there is a better solution.
The real way to solve it is to pop a dialogue and ask the user which of the matching boards should be used. That would only need to happen if the board doesn't have the mobile flight firmware already on it because once the firmware is on it the new board system knows what it is for real
@DocMoebiuz so should we do this or nah? 😂
i thought we have everything we need now
With the changes you added to handle ambiguous boards we could. Requires:
- Building and bundling a nano built firmware
- Adding the nano board.json
And old / new bootloader is considered? I tried to use 2.json files which just differ in the bootloader parameter, but this was not the best idea.
That would work but would mean every nano is ambiguous.
From: elral @.> Sent: Wednesday, November 16, 2022 10:22:27 AM To: MobiFlight/MobiFlight-Connector @.> Cc: Neil Enns @.>; Mention @.> Subject: Re: [MobiFlight/MobiFlight-Connector] Support Arduino Nano (Issue #579)
And old / new bootloader is considered? I tried to use 2.json files which just differ in the bootloader parameter, but this was not the best idea.
— Reply to this email directly, view it on GitHubhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMobiFlight%2FMobiFlight-Connector%2Fissues%2F579%23issuecomment-1317468290&data=05%7C01%7C%7Cf8a65424ed0247a331eb08dac7ff847d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638042197505425447%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=n7tUEA3dRb75aUV%2FY7YQwrxRcO9VbAWxtGjUzy%2FoAmI%3D&reserved=0, or unsubscribehttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FACIVHFVSTIXSVVDACHY6EVDWIUQ6HANCNFSM5IOT2N6A&data=05%7C01%7C%7Cf8a65424ed0247a331eb08dac7ff847d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638042197505425447%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=1umXC5lGbRccfSj7eK%2FVbwu6feNTO566RIyTfRwAXKc%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.***>
And old / new bootloader is considered? I tried to use 2.json files which just differ in the bootloader parameter, but this was not the best idea.
that's how it is in the arduino IDE iirc. Arduino nano (old bootloader)
@neilenns no board is recognized if 2 json files with the same type but different Baud rate are n the board folder. I couldn't find another way as to use 2 environments in PlatformIO for new and old bootloader and different Mobiflight types with 2 json files accordingly.
Ahhhh right. Would need to report two different MobiFlight type which is weird because they would be identical otherwise. Hmmmmm.
Maybe we should move the type to the platformio.ini file so at least the board file can be double used. Same would apply for the Leonardo (just a question on Discord)
It just seems wrong to ship two firmwares that are identical other than MobiFlight type. This can probably be solved in the desktop side by grabbing all matching boards. I'll look later.
From: elral @.> Sent: Wednesday, November 16, 2022 11:02:43 AM To: MobiFlight/MobiFlight-Connector @.> Cc: Neil Enns @.>; Mention @.> Subject: Re: [MobiFlight/MobiFlight-Connector] Support Arduino Nano (Issue #579)
Maybe we should move the type to the platformio.ini file so at least the board file can be double used. Same would apply for the Leonardo (just a question on Discord)
— Reply to this email directly, view it on GitHubhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMobiFlight%2FMobiFlight-Connector%2Fissues%2F579%23issuecomment-1317527162&data=05%7C01%7C%7Ce2bc242edaf849539b0f08dac8052507%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638042221672567964%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=97gEVj2iU0FyduXPh9QItTs79EwFeAo45i8rxKHLMTM%3D&reserved=0, or unsubscribehttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FACIVHFTN74RMP67GJ64TG5LWIUVVHANCNFSM5IOT2N6A&data=05%7C01%7C%7Ce2bc242edaf849539b0f08dac8052507%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638042221672567964%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=wAWu%2FFsh0K3JVUeXA%2FsPZaG6dsQzvgfn%2B5Hg9rmcoIc%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.***>
Thinking about this more on the drive home the Nano is a giant pain. Even if we had firmware that reported two different MobiFlight Type values we still wouldn't know what baud rate to use when connecting to the board in the first place. It's a circular loop: to connect to the board we need to know the baud rate, but we don't know the baud rate unless we connect to the board and ask its type.
Even after flashing the board in the first place this would be a problem on every launch of MobiFlight on the desktop.
Possible solutions would be:
- Caching the working baud rate for each COM port
- Trying each matching board file in order until one of them works every time we want to connect
- Asking the user every time MobiFlight runs what kind of nano it is
All of these require real coding work beyond just shipping a .board.json and firmware.
i was going with the assumption that the baudRate adjustment was only required for the bootloader when uploading the sketch. Is it really every time that you would want to connect?
I am right with my assumption. It is only required for uploading the sketch. So we could very well talk to it during normal MF operations regardless of the variant.
Only the avrdude settings are different for one or the other. That is already supported.
I am using both types since month w/o problems, just the two different json files and 2 different environments in PlatformIO.
Ah, I thought the baud rate mattered when talking to the board after flash as well. Ok, let me go investigate some stuff on the Mobiflight board.json side of things.
Opened a PR to support multiple baud rates in a given board.json file. No idea if it works. Someone with the two different Nanos should try it 😀
https://github.com/MobiFlight/MobiFlight-Connector/pull/1015