I’m working on a project where I want to install a Nano Every inside a wall. I want to be able to attach to the USB port to monitor it and do software updates. The only wall plate I’ve been able to find with a USB port is USB-C female to USB-C female. I can attach to the Every with a micro-USB to USB-C male adapter to the wall plate, and a USB-C male to male between the wall plate and my computer.
The first time I attach, it works fine. If I disconnect and reconnect, all hell breaks loose. I can’t connect, and in order to reconnect I have to restart both my computer and the Arduino.
Tell us in more detail about this project. It was probably not properly designed to be freestanding in a wall.
In such cases, the program must be written to work autonomously, without connecting a PC. The diagnostic output is usually excluded, the program does not output anything to the serial. In extreme cases, the diagnostics can be transmitted over a radio channel.
Updates are rarely required, so any connector can survive two or three connections a year.
If I understood correctly from the description, you were connecting to the USB-C adapter in the wall, and not to the board itself. That is, the problems only concern the adapter... Why not just replace it?
There are all sorts of ways to tackle this.
UK or USA style wall plates?
Solid wall or drywall (plasterboard and studwork)?
There's plenty of room in drywall to accommodate extra electronics. I extend UK drywall back boxes by stitching two together for extra depth.
The USB socket generally included is for charging purposes, though, pins permitting, could be adapted to data as well.
There are also "grid" modules (up to three in a UK single gang outlet).
I know they include Ethernet and telephone modules and probably USB.
Easy to remove, provide access and replace.
All very doable.
I have WiFi light controllers, thermostats, LAN outlets all through the house, all in drywall.
Do you see this error or similar, probably with a yellow triangle ?:
The last USB device you connected to this computer has malfunctioned and windows doesn't recognize it" / "Unknown USB Device (Device Descriptor Request Failed)
Yes, the first time that the connection fails. After that I get no response from the PC and I have to reboot the PC and power cycle the Arduino to get the connection again.
Since the PC doesn’t recognize the USB device, no application – neither the IDE nor any terminal emulator – recognizes the serial port.
You’re the only one who seems to understand the issue, so let me add some detail. The Arduino in the wall is independently powered. It works fine. If I connect to it using a USB micro to USB-A cable, I can connect and monitor it and upload updates. But then I have a USB cable hanging out of the wall.
What I’d rather do is have a USB port in the wall. Then I can plug into it when I need to. The wall plate I was able to find was USB-C to USB-C. It’s when I involve that wall plate that I get the issue.
The solution might be as simple as locating a USB-A to USB-A wall plate and sticking with old-school USB. That’s not my first choice because I prefer the appearance of the USB-C, it’s less visually obtrusive.
I was just wondering whether this was a known issue with the Every, my experience with Arduino is that when you start experiencing unexpected behavior it’s often a known issue with known workarounds.
One factor might be how the Every is powered and what happens when the USB lead is plugged in and supplies power as well. I do not know enough about the Every to be able to provide advice
What happens if you connect the Every directly to the PC and power it with an external supply and then unplug the USB and plug it back in again ?
I don't see a path from the Nano's either 5v or Vin to VUSB which could explain this.
When the Nano is behind the wall normally, but without you attempting to program it, which connection are you using to power it a) the Vin pin, b) the 5V pin or c) the USB socket or d) something else ?
Disclaimer: knowing next to nothing about USB-C power delivery negotiation other than it exists, I wonder if one of your USB-C adapters has the CC line attached and the PC is seeing that as an attempt to negotiate. Something that the Every will know nothing about.
Edit: which likely won't be a factor unless the computer being plugged into has a USB-C connector itself.
I bought a USB-A female to USB-A female connector:
This goes in a keystone wall plate and gets the USB through the wall. On the Arduino I have a USB-micro to USB-A male cable, from the connector to my computer I use a USB-A male to USB-A male cable.
So I completely removed USB-C from the picture. Everything seems to work now.
I have no idea what was going on with USB-C, but I thought I’d report back in case anyone following me has a similar issue.
Unless you have a USB all types cable tester you may never know if one of the previous cables was not wired the way you thought. By purchasing those adapters you have eliminated that problem. Congrats, mark post 15 as the solution
USB-C is bacward compatible, BUT not all USB-C cables are created equal also the same for USB-1, 2, 3 maybe even USB-4. I doubt very strongly it was something other than a bad cable or connector, not inherent since I do it dozens of times a day. do have a tester though that is compehensive and I have found the odd bad cable.
For example, I just tested a high grade USB-C to USB-C that I use with the high grade HD I use to clone my Mac with. One end shows all 12 lines lit up, the other side only 10. The 2 missing are the USB-2 Data lines. Since I know this cable works, that missing 2 must be by design. Maybe you encountered something like that.
This is “normal” behavior. If the serial connection is active and you unplug it without disconnecting it properly first, then what you describe will happen. In most cases, the only solution is to restart the computer. Before unplugging the Every, close the serial connection on the computer.