Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Teensy Ethernet for wired laptop-to-pod setup #59

Open
3 of 4 tasks
mbardwell opened this issue Apr 12, 2022 · 6 comments
Open
3 of 4 tasks

Teensy Ethernet for wired laptop-to-pod setup #59

mbardwell opened this issue Apr 12, 2022 · 6 comments
Assignees
Labels
Hardware Requires hardware modifications test A unit or integration test feature request

Comments

@mbardwell
Copy link
Collaborator

mbardwell commented Apr 12, 2022

Summary

Our wired setup looks like this. We need a Teensy ethernet cape to connect the Teensy to a laptop via an cat5e/6 Ethernet cable.

image

There are existing Teensy Ethernet modules available. They look like this.
image

Acceptance Criteria

  • hardware selected
  • hardware purchased
  • hardware put together
  • basic software testing
    • something like plug a Teensy into the RPi and then the Teensy's Ethernet into the passive switch. From there, the programmer can set a static IP (assumedly) and then try to ping the device (?)

The test setup looks something like this
image

@mbardwell mbardwell added Hardware Requires hardware modifications test A unit or integration test feature request labels Apr 12, 2022
@mbardwell
Copy link
Collaborator Author

mbardwell commented Apr 12, 2022

Alex purchased 5 of these https://www.pjrc.com/store/ethernet_kit.html. They are for the Teensy 4.1

image

Here are two setup
image

@mbardwell
Copy link
Collaborator Author

Tried this https://github.com/vjmuzik/NativeEthernet/tree/master/examples/WebServer. It loads on the Teensy just fine (ie. we see Ethernet WebServer Example) over serial, but the server does not respond to http requests.

To find your Ethernet controller's MAC address, follow this.

Suggested code changes to the WebServer

byte mac[] = {
  0x04, 0xe9, 0xe5, 0x11, 0xb4, 0x75
};
IPAddress ip(129, 128, 214, 177);

HTTP request

pi@raspberrypi:~ $ curl -v http://129.128.214.177:80/

@mbardwell
Copy link
Collaborator Author

Made some more progress today. From reboot, I can temporarily receive UDP packets over Ethernet. After some time, it stops working

Starting Ethernet with IP: 129.128.214.100 and MAC: 04:E9:E5:11:B4:75
Starting UDP. Listening to port: 31548
Received packet of size 13
From 129.128.214.121, port 52182
Contents:                                         
Hello, World!                                     
Received packet of size 13
From 129.128.214.121, port 43011
Contents:                                         
Hello, World!                                     
Received packet of size 13
From 129.128.214.121, port 55248
Contents:                                         
Hello, World!                                     
Received packet of size 13
From 129.128.214.121, port 50405
Contents:                                         
Hello, World! 

Here's a GIF of Wireshark showing the packet is being sent to the right address and port. Click on it for a better resolution.

ethernet_w_wireshark

To run Wireshark remotely

$ wireshark -k -i <(ssh -l pi remotepi "dumpcap -i eth0 -P -w - -f 'udp and port 31548'")

To send UDP packets to IP/Port

$ python3 Documents/mike/udp_send.py

@mbardwell
Copy link
Collaborator Author

mbardwell commented May 6, 2022

From reboot, I can temporarily receive UDP packets over Ethernet. After 30 packets, it stops working

Gil, Alex and I debugged this today. When the Teensy is connected directly via Ethernet to the RPi with no switch in the middle, we can send UDP packets for over two minutes without any problems.

I suspect the sheer number of messages being received by the Teensy's Ethernet adaptor is causing the problem. Perhaps increasing some buffer size somewhere could quickly fix the issue.

hello_ethernet_ack.hex

I submitted this question to the forums

@Iyury1
Copy link
Contributor

Iyury1 commented Jun 21, 2022

I modified the Network communications requirements document.
Albertaloop\1 - Technical Division\1 - Electrical Team\1 - Software Group\4 - Requirement Documents\T_SWE_UNIT_REQUIREMENTS - Network Communications

I also slightly modified the design plan document.
Albertaloop\1 - Technical Division\1 - Electrical Team\1 - Software Group\5 - Design Plans\T_SWE_PLAN - Network Communications

Whoever will be resuming Software testing, please review our previous work on the Command and Telemetry modules located here:
https://github.com/albertaloop/T_SWE_2019_2020/tree/cody-pod-telemetry-program
https://github.com/albertaloop/T_SWE_2019_2020/tree/cody-obc/Firmware/obc

To start with we need a program for a Teensy 4.1 to send and receive UDP packets between a separate Python program. Start a new Github Branch and provide code documentation into the Design Plan document.

@Iyury1
Copy link
Contributor

Iyury1 commented Jun 24, 2022

Remote development will have to be used if you are not located in Edmonton. Here is some documentation on the remote development setup, which further links to additional documentation.
Albertaloop\1 - Technical Division\1 - Electrical Team\1 - Software Group\3 - Research Documents\Remote Development on Microcontrollers

Also take a look at the previously closed issue on Remote Development #34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hardware Requires hardware modifications test A unit or integration test feature request
Projects
None yet
Development

No branches or pull requests

3 participants