Ethernet FeatherWing MAC / IP troubles circuitpython

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
HorstO
 
Posts: 34
Joined: Fri Jan 09, 2015 7:46 pm

Ethernet FeatherWing MAC / IP troubles circuitpython

Post by HorstO »

Hi, I am using a ESP32-S2 TFT Feather (https://www.adafruit.com/product/5300) with the ethernet feather wing (https://www.adafruit.com/product/3201) via a FeatherWing doubler (https://www.adafruit.com/product/2890).

I have added a screenshot of what I am getting with the example ethernet featherwing circuitpython code (same as provided here: https://learn.adafruit.com/ethernet-for ... thon/usage).

First of all, I am getting a strange MAC address printed out (the string reads "deadbeeffeed" which sounds like a debug string) - it certainly does not match the one that was delivered with the ethernet featherwing (print on sticker). I need the correct MAC address to hook it up to the ethernet in my institute.

Then, adafruit.com is successfully looked up, but even for the "text" URL

Code: Select all

TEXT_URL = "http://wifitest.adafruit.com/testwifi/index.html"
I am getting an immediate error: SSL not supported by circuitpython library.

I don't think the problems are related, but I would be grateful for some advice on either!
Attachments
screenshot repl
screenshot repl
deevice1.PNG (3.25 KiB) Viewed 147 times

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: Ethernet FeatherWing MAC / IP troubles circuitpython

Post by mikeysklar »

The default mac address is set in the CircuitPython library. It is DEADBEEF just as you see in the example code.

Code: Select all

# Default hardware MAC address
DEFAULT_MAC = (0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED)
https://github.com/adafruit/Adafruit_Ci ... iznet5k.py

SSL is not supported with CircuitPython:

Code: Select all

        :param tuple address: Remote socket as a (host, port) tuple.
        """
        assert (
            conntype != 0x03
        ), "Error: SSL/TLS is not currently supported by CircuitPython."
https://github.com/adafruit/Adafruit_Ci ... arch?q=ssl

User avatar
HorstO
 
Posts: 34
Joined: Fri Jan 09, 2015 7:46 pm

Re: Ethernet FeatherWing MAC / IP troubles circuitpython

Post by HorstO »

Thanks, @mikeysklar, all clear!

User avatar
blakebr
 
Posts: 942
Joined: Tue Apr 17, 2012 6:23 pm

Re: Ethernet FeatherWing MAC / IP troubles circuitpython

Post by blakebr »

Mike,

If I read you right CP assigns the same MAC address to all interfaces. Won't there be an issue with multiple CP managed ethernet devices having the same MAC address of de:ad:be:ef:fe:ed? I had that problem when I purchased several low cost micro-USB to Ethernet converters for my RPi Zero W devices. I spent many hours trying to figure out what the problem was. When I found that they all had the same MAC address they went in the trash and I got better ones. No problems since.

Bruce

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: Ethernet FeatherWing MAC / IP troubles circuitpython

Post by mikeysklar »

Bruce,

You assign the mac address in the CircuitPython script (with the constructor mac=)so it is very much in the hands of the user. I like that it is easy to change and does not require any obscure tools. It can make it easy to identify and differentiate your boards.

Code: Select all

class adafruit_wiznet5k.adafruit_wiznet5k.WIZNET5K(spi_bus, cs, reset=None, is_dhcp=True, mac=(222, 173, 190, 239, 254, 237), hostname=None, dhcp_timeout=30, debug=False)
https://docs.circuitpython.org/projects ... k.WIZNET5K

User avatar
blakebr
 
Posts: 942
Joined: Tue Apr 17, 2012 6:23 pm

Re: Ethernet FeatherWing MAC / IP troubles circuitpython

Post by blakebr »

Mike,

I am glad to see there is a way. I would like to do it on an RPi Pico W with CP 8.0.0 Beta 5. As I don't setup the SPI buss, how would I do it for this MC? TIA

Bruce

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: Ethernet FeatherWing MAC / IP troubles circuitpython

Post by mikeysklar »

For an RP2040 you would set the mac using something like this:

Code: Select all

spi_bus = busio.SPI(board.GP6,board.GP7,board.GP4), board.GP9)

eth = WIZNET5K(spi_bus, mac=(222, 173, 190, 239, 254, 237))

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”