Help for arduino mega2560

Hello, good afternoon. My name is Patricio, a high school student from an industrial school in Argentina. The school is part of an inter-school aerospace-themed project. Our proposal is to make a series of measurements in the atmosphere by launching a payload on a rocket, and as an innovation, we want to apply RIOT on an Arduino Mega2560. We are having many problems trying to install it. We have tried many methods, but none of them end up installing the system on the board. We are trying to install it from various versions of Ubuntu, and we have problems with drivers and keys to install these. It would be very helpful if you could provide us with a foolproof method for flashing the system. PD: we are using a generic Arduino Mega2560.

Whether with a virtual machine or with a real Ubuntu, the system cannot recognize the connected Arduino, or at least that’s what I think the problem is. I tried plugging it into all the USB ports, from 0 to 3. I understand that the issue is due to the lack of drivers, specifically for the CH340PCB, which I’m unable to install on the system. Any driver I try to install from the terminal gives me the following message: “Key was rejected by service.”

Can you give me some solutions or other methods to install RIOT on Arduino 2560?

Clarifying again, we are using a generic Arduino Mega2560 Thank you very much.

Do you have the USB device forwarded to the VM? Do you see something in dmesg -w when you plug it in?

I think you can’t use a wildcard there, try PORT=/dev/ttyUSB0. Are you in the dialout group?

I tried it on VM, I had configured the USB input on Ubuntu, I don’t have knowledge of the rest you told me, I followed this tutorial: How to setup RIOT OS on Arduino with VirtualBox - YouTube

Right now i’m trying to install this in real Ubuntu

I followed the tutorial until minute 12:35 of the video, where the subject encounters the same error as me. I configured the USB input to the VM and it didn’t work. I researched in various forums that the Arduino Mega2560 has issues when trying to configure it from a virtual machine, so I decided to install Ubuntu on my PC in order to install RIOT. But the same problem continues to happen.

What happens when you type dmesg -w in a terminal and plug the device in?

Right now I don’t have the Arduino at my disposal, I’ll be able to try it in a couple of hours. In the meantime, could you tell me about other possible solutions? Sorry for the inconvenience and thank you very much. If my English is very good, it’s because I’m translating a message in Spanish.

To know possible solutions we first have to understand what’s the problem.

When I plug in my Arduino Mega2560 clone I get

[17243.676301] usb 1-1.1.3.3: new full-speed USB device number 29 using ehci-pci
[17243.785421] usb 1-1.1.3.3: New USB device found, idVendor=1a86, idProduct=7523, bcdDevice= 2.54
[17243.785432] usb 1-1.1.3.3: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[17243.785436] usb 1-1.1.3.3: Product: USB2.0-Serial
[17243.786015] ch341 1-1.1.3.3:1.0: ch341-uart converter detected
[17243.787126] usb 1-1.1.3.3: ch341-uart converter now attached to ttyUSB2

So the device is immediately recognized without me having to install any drivers, so I wonder why you don’t get a /dev/ttyUSB* device.

[17243.786015] ch341 1-1.1.3.3:1.0: ch341-uart converter detected
[17243.787126] usb 1-1.1.3.3: ch341-uart converter now attached to ttyUSB2

I just wanted to re-iterate that there are no drives to install. ch341 drivers are stock.

When i type dmesg -w, the terminal send me this

translated to english says: dmesg: failed to read kernel buffer: Operation not allowed

If would be great if you could copy&paste the text rather than a screen shot. That would be easier to read.

later kernels/ubuntu do not allow “mortal” users to see the dmesg output. so you need to do:

sudo dmesg -w 

or, you can do:

sudo sysctl -w kernel.dmesg_restrict=0
dmesg -w 

If you want this to be permanent, then create /etc/sysctl.d/05-dmesg.conf with the content:

kernel.dmesg_restrict=0

It will look a bit different on a genuine Mega2560 or with a good clone: They use an ATmega16U2 for USB <–> UART translation.