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

Support for Portenta H7 #53

Open
fkromer opened this issue Oct 11, 2021 · 18 comments
Open

Support for Portenta H7 #53

fkromer opened this issue Oct 11, 2021 · 18 comments

Comments

@fkromer
Copy link

fkromer commented Oct 11, 2021

Describe the feature

Higher end devices like the Portenta H7 do not provide pgmspace.h. This leads to a compilation error when trying to build code which uses mWebSockets on such a device (file not found error). One way to solve this issue is to provide a pgmspace.h file on the device driver side (more info about this here: arduino/ArduinoCore-mbed#343). Another way is to implement device conditional compilation, meaning adding Portenta H7 to here and here.

@skaarj1989 @facchinm I could provide a PR if you are ok with the second alternative how to extend support of the lib. If not one would have to take the first approach instead. It seems like there is no best practice about which approach to prefer over the other in the Arduino ecosystem BTW.

Environment info

n.a.

Expected behavior

Should compile on Portenta H7.

Additional context

n.a.

@skaarj1989
Copy link
Owner

@fkromer I added initial support in mbed_portenta branch. It compiles, but I don't have a Portenta board, so I can't verify whether it works or not.

@fkromer
Copy link
Author

fkromer commented Oct 11, 2021

@skaarj1989 Thanks a lot. simple-server.ino compiles 🚀

@fkromer fkromer closed this as completed Oct 11, 2021
@skaarj1989
Copy link
Owner

@fkromer If you have a Portenta board, could you verify if the code is working?

@skaarj1989 skaarj1989 reopened this Oct 11, 2021
@fkromer
Copy link
Author

fkromer commented Oct 11, 2021

@skaarj1989 Mh, the example will not work via Wifi I guess. According to the schematic of the Portenta H7 the Wifi chip on the Portenta H7 is LBEE5KL1DX. You are expecting some Wxxxx chip, right?

@skaarj1989
Copy link
Owner

(...) You are expecting some Wxxxx chip, right?

Yes, that would be nice.

@fkromer
Copy link
Author

fkromer commented Oct 11, 2021

@skaarj1989 The Portenta H7 passes the ethernet signals via one of the two 80 pin connectors to the board in use. I've a machine control board at hand and can try this one.

@fkromer
Copy link
Author

fkromer commented Oct 11, 2021

(...) You are expecting some Wxxxx chip, right?

Yes, that would be nice.

The Wifi chip on the Portenta H7 is LBEE5KL1DX. Should be ok to just get rid of the outer #if NETWORK_CONTROLLER == ETHERNET_CONTROLLER_W5X00 probably.

@fkromer
Copy link
Author

fkromer commented Oct 11, 2021

@skaarj1989 This ethernet connection

byte mac[]{0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
IPAddress ip(192, 168, 1, 2);

means random mac should be ok. The ip address is in the subnet range of my interface. Should be ok as well. I get this serial terminal output:

Initializing ... 
Server running at 0.0.0.0:3000

However I cannot establish a websocket connection.

@skaarj1989
Copy link
Owner

@fkromer Server running at 0.0.0.0:3000 Obviously this is bad.
Try to run WebClient demo and see if you can get valid IP address.

@fkromer
Copy link
Author

fkromer commented Oct 11, 2021

Obviously this is bad.

@skaarj1989 Yepp

@fkromer
Copy link
Author

fkromer commented Oct 12, 2021

@skaarj1989 The WebClient demo works with DHCP. The random mac address is the same like in simple-server.ino. There is no need to watch out for a mac printed on a sticker. I'll try the websockets example with dhcp as well.

@fkromer
Copy link
Author

fkromer commented Oct 12, 2021

@skaarj1989 I've tried with a router and static IP. The server should be running on the static IP.

Initializing ... 
Server running at 192.168.178.211:3000

However I cannot establish a websocket connection. I get an error: socket hang up.

@fkromer
Copy link
Author

fkromer commented Oct 12, 2021

I've tried with static IP again. The server seems to have an IP.

Initializing ... 
Server running at 192.168.1.2:3000

However I still cannot estabish a connection due to error: socket hang up.

Is the print output Server running ... really indicating a running server or does it just return the local IP (_SERIAL.print(Ethernet.localIP());)?

@skaarj1989
Copy link
Owner

@fkromer Could you verify if WebSocketClient is working?

@fkromer
Copy link
Author

fkromer commented Oct 12, 2021

@skaarj1989 Sure. ATM I cannot span a websocket server on my machine. Do you know some public websocket server I could connect to? I used to use http://www.websocket.org/ however the service is not available anymore.

@stale
Copy link

stale bot commented Nov 11, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 11, 2021
@fkromer
Copy link
Author

fkromer commented Nov 11, 2021

@skaarj1989 Just want let you know that I do not need this feature anymore.

@stale stale bot removed the stale label Nov 11, 2021
@skaarj1989
Copy link
Owner

Anyways, support for Portenta board would be nice to have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants