Closed notro closed 5 years ago
Hmmm, okay, I don't have a Grand Central but I've got a Metro M4 Express which is hopefully similar enough to have the same problem, and a W5500 Feather Wing on an adaptor shield. I'll have a look and check it's working for me ...
OK I've got my devices set up running 4.0.0-beta.1-11-g388448215 and it's working for me with the Metro M4 Express and W5500 Feather Wing.
I did have some trouble when I first plugged it all together, with the Ethernet module on top the power is getting close to its limit and the board repeatedly reset itself until I plugged it into a better USB hub. An external power supply should help there too.
If the remote server times out you'll get an Input/Output error as you described, though.
I'm a little puzzled by your build errors shown though: make BOARD=grandcentral_m4_express
is building fine here without modification.
I tried powering through the DC jack just in case I was balancing on the power limit, but it didn't help. Pinging the board works just fine.
I think I'll just drop this for now. I was hoping for an easy way of getting network on this board so I could start porting the network modules in the CPython standard library. It will have to wait.
How do you enable the driver when building? AFAICT it's not enabled on any boards.
It's enabled by default for some of the "express" boards but not the grand central for whatever reason.
Easiest way is to edit ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.mk
and add the lines:
MICROPY_PY_NETWORK = 1
MICROPY_PY_WIZNET5K = 5500
I'll get hold of some hardware when I can and see if I can replicate ...
Thanks, I didn't check the makefiles...
I tried it on an Metro M4 Express and I get same result. I can ping the board, it is able to resolve the dns name, but fails when sending:
Adafruit CircuitPython 4.0.0-beta.2 on 2019-02-05; Adafruit Metro M4 Express with samd51j19
>>>
>>>
>>> import board
>>> import busio
>>> import wiznet
>>> import socket
>>> import time
>>>
>>> spi = busio.SPI(clock=board.SCK, MOSI=board.MOSI, MISO=board.MISO)
>>> eth = wiznet.WIZNET5K(spi, board.D10, board.D11)
>>> eth.connected
True
>>> time.sleep(10)
>>> eth.ifconfig()
('192.168.10.179', '255.255.255.0', '192.168.10.1', '0.0.0.0')
>>> host = 'example.com'
>>>
>>> fam, typ, pro, nam, sockaddr = socket.getaddrinfo(host, 80)[0]
>>> ss = socket.socket(fam, typ, pro)
>>> sockaddr
('93.184.216.34', 80)
>>> ss.connect(sockaddr)
>>> ss.send(b"GET / HTTP/1.0\r\n\r\n")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 5] Input/output error
>>>
The socked code works fine on an RPi sitting next to it.
I think 'll just close this for now and maybe pick this up later.
@notro please see #1800 for what I hope is a fix!
I'm using an Ethernet Shield for Arduino - W5500 Chipset with an Adafruit Grand Central M4 Express
However I'm getting an error. Yesterday it always failed when sending, today it fails when receiving:
It errors out in the CHECK_SOCKMODE macro:
This is what I did to make it build:
cc: @nickzoic