How to use network.LAN on NUCLEO_F429

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Post Reply
chg
Posts: 1
Joined: Tue Aug 13, 2019 11:21 am

How to use network.LAN on NUCLEO_F429

Post by chg » Tue Aug 13, 2019 11:25 am

Hello,

either I am too stupid or there is no explanation how exactly to use the network interface on the mentioned nucleo.

I successfully compiled the latest micropython from github with

make BOARD=NUCLEO_F429ZI -j8 MICROPY_HW_ENABLE_ETH_RMII=1

and the autocompletion shows the existance of "network.LAN" on the REPL but i don't succedd with starting the LAN and requesting an IP address using DHCP.

Any example that helps me to get started?

User avatar
jimmo
Posts: 791
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia

Re: How to use network.LAN on NUCLEO_F429

Post by jimmo » Tue Aug 13, 2019 2:11 pm

Can you share your code that you're using to request a DHCP lease?

I don't have one of these boards, but I think it should be something like:

Code: Select all

import network
lan = network.LAN()
lan.active(True)
lan.ifconfig('dhcp')
# use lan.ifconfig() to wait for lease

kcoelho
Posts: 23
Joined: Fri Aug 02, 2019 5:40 pm

Re: How to use network.LAN on NUCLEO_F429

Post by kcoelho » Fri Aug 16, 2019 3:37 pm

Hi,

When I enter the command "network.LAN()" in the REPL prompt, the prompt itself shuts down.

Any ideas as to why this happens?

User avatar
ta1db
Posts: 35
Joined: Mon Sep 02, 2019 12:05 pm
Contact:

Re: How to use network.LAN on NUCLEO_F429

Post by ta1db » Wed Sep 11, 2019 7:58 am

jimmo wrote:
Tue Aug 13, 2019 2:11 pm
Can you share your code that you're using to request a DHCP lease?

I don't have one of these boards, but I think it should be something like:

Code: Select all

import network
lan = network.LAN()
lan.active(True)
lan.ifconfig('dhcp')
# use lan.ifconfig() to wait for lease
This worked well on STM32F7DISC without any error. Now I have a connection on my LAN named as mpy.local but there is no any service yet. I am working on.

By the way @jimmo you helped me very much once again, thank you so much, if I'm correct I don't need to install the Ethernet module https://github.com/forester3/micropytho ... net-F7DISC for a LAN connection.

ps. >>>lan.ifconfig() produces the following:
('192.168.1.58', '255.255.255.0', '192.168.1.1', '192.168.1.1')
without any network interface .

Post Reply