Giter Site home page Giter Site logo

Comments (10)

cuvoodoo avatar cuvoodoo commented on August 16, 2024 1

I used the UF2 artifact from https://github.com/OpenLightingProject/rp2040-dmxsun/actions/runs/2561833425 , and compiled master myself. the behaviour is the same.

there is no USB issue:

Aug 17 16:15:12 diode kernel: usb 1-1.3.1.2: new full-speed USB device number 84 using xhci_hcd
Aug 17 16:15:12 diode kernel: usb 1-1.3.1.2: New USB device found, idVendor=1209, idProduct=aceb, bcdDevice= 1.00
Aug 17 16:15:12 diode kernel: usb 1-1.3.1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Aug 17 16:15:12 diode kernel: usb 1-1.3.1.2: Product: rp2040-dmxsun http://169.254.59.1/
Aug 17 16:15:12 diode kernel: usb 1-1.3.1.2: Manufacturer: OpenLightingProject
Aug 17 16:15:12 diode kernel: usb 1-1.3.1.2: SerialNumber: RP2040_e6605481db933b36
Aug 17 16:15:12 diode kernel: hid-generic 0003:1209:ACEB.0015: hiddev99,hidraw3: USB HID v1.11 Device [OpenLightingProject rp2040-dmxsun http://169.254.59.1/] on usb-0000:05:00.3-1.3.1.2/input0
Aug 17 16:15:12 diode kernel: cdc_acm 1-1.3.1.2:1.1: ttyACM0: USB ACM device
Aug 17 16:15:12 diode kernel: cdc_ncm 1-1.3.1.2:1.3: MAC-Address: 02:02:84:6a:96:00
Aug 17 16:15:12 diode kernel: cdc_ncm 1-1.3.1.2:1.3 usb0: register 'cdc_ncm' at usb-0000:05:00.3-1.3.1.2, CDC NCM, 02:02:84:6a:96:00
Aug 17 16:15:12 diode dhcpcd[142366]: usb0: waiting for carrier
Aug 17 16:15:12 diode dhcpcd[142366]: usb0: carrier acquired
Aug 17 16:15:12 diode kernel: IPv6: ADDRCONF(NETDEV_CHANGE): usb0: link becomes ready
Aug 17 16:15:12 diode dhcpcd[142366]: usb0: IAID 84:6a:96:00
Aug 17 16:15:14 diode dhcpcd[142366]: usb0: soliciting a DHCP lease
Aug 17 16:15:14 diode dhcpcd[142366]: usb0: offered 169.254.59.2 from 169.254.59.1
nothing further

the request is also not acked when I trigger the DHCP client manually.

I attach a PCAP for detailed view. Maybe some bit fields are different.
dmxsun_dhcp.pcapng.gz

from rp2040-dmxsun.

kripton avatar kripton commented on August 16, 2024

Okay, that's strange, works on my machine. Will do a wireshark trace this evening an compare with yours.
In the meantime, is there anything strange in the kernel logs? USB device resetting or similar?

from rp2040-dmxsun.

kripton avatar kripton commented on August 16, 2024

Just checked, I can definitely see a DHCP ACK here:
grafik
Did you build the source code yourself or did you use some UF2-file from the GitHub actions?

The DHCP server is part of the lwIP-stack, it's not written by me. I might be able to add or active some debugging options but I didn't yet dig into it.

from rp2040-dmxsun.

gobo-ws avatar gobo-ws commented on August 16, 2024

I had the same problem with a UF2-file from the GitHub actions (https://github.com/OpenLightingProject/rp2040-dmxsun/suites/6080805161/artifacts/210508458)

from rp2040-dmxsun.

kripton avatar kripton commented on August 16, 2024

Thanks for the pcap-file, that will help a lot. Unfortunately, I didn't yet find the time to investigate the root cause :/

from rp2040-dmxsun.

kripton avatar kripton commented on August 16, 2024

I did some investigation today. First thought: Only "a limited amount" of requests can be served. Proofed wrong.
Then I tried dhcpcd as DHCP client and I can reproduce the failing behaviour of not getting the DHCP ACK. However, when I use NetworkManager's internal DHCP client afterwards on the same connection (= without disconnecting the board), it serves the DHCP ACK just fine. However, still no explanation why this happens. The DHCP server code is not written by me but I will try to debug it to see where it fails.

from rp2040-dmxsun.

kripton avatar kripton commented on August 16, 2024

I think I found the root cause: tinyUSB's DHCP server expects the MESSAGETYPE option in DISCOVER or REQUEST packages to be the first option in the packet. Some clients seem to not to adhere to this expectations. The trace you attached and the "dhcpcd" I tried send the requested IP option first.

Pull-request for tinyUSB has been created, but it might take some time until the fix makes it into tinyUSB and from there into the pico-sdk. I might try to hack something together so the builds created by the GitHub actions behave correctly.

In the meantime, here's an UF2-file that includes the fix: rp2040-dmxsun.zip.
Might be a DEBUG build containing some more logging statements than required but it would be nice if you could confirm that this fixes the issue. Thanks!

from rp2040-dmxsun.

kripton avatar kripton commented on August 16, 2024

Fix has been merged upstream. I now need to check if I can update to the latest upstream master of tinyUSB or if there are incompatibilities that I need to fix. Thus, leaving this open

from rp2040-dmxsun.

kripton avatar kripton commented on August 16, 2024

Alright, I'm working on a way to fix this locally without waiting for the upstream version of tinyUSB to tickle down into the pico-sdk.

from rp2040-dmxsun.

kripton avatar kripton commented on August 16, 2024

Should be fixed with #68.
I copied the DHCP server code into the project to be able to modify it.

from rp2040-dmxsun.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.