2

I recently installed Micropython on my Raspberry Pi model 3. I followed all the steps mentioned in the Raspberry pi - how to guide. https://www.raspberrypi.org/forums/viewtopic.php?t=191744

But, when I try to import the network module, it throws a 'module not found' error. I have searched a lot for the solution to my problem, but haven't found a solution yet.

I searched for the micropython-network module but it is not available on https://pypi.org/search/?q=micropython+network The closest ones are micropython-cpython-network and network. I tried using the network module but it doesn't contain the functions that I require (e.g.: WLAN). Also, I have used Micropython on the ESP32. It works fine. No errors.

I think this is something Raspberry Pi-specific.

When I write this:

import network

The error message shows:

Traceback (most recent call last):
  File "<stdin>" ,line 1, in <module>
ImportError: no module named 'network'
Adarsha
  • 21
  • 1
  • 7
  • As I know [`network`](http://docs.micropython.org/en/v1.9.3/esp8266/esp8266/tutorial/network_basics.html) module can be only used with esp8266, and I think it is absent in the general configuration of Micropython. By the way, if you build that you can't use it as it is defined to work with esp module. – Masoud Rahimi Jun 20 '19 at 06:46
  • You mean that only ESP8266 and ESP32 support the _network_ module; So, do I need to use the same microcontrollers for production as well, if I use the _network_ module? – Adarsha Jun 20 '19 at 10:49
  • Yes, I'm not sure what you are trying to do but using Micropython with Pi is weird. Micropython intended to use with boards that don't support python natively. – Masoud Rahimi Jun 20 '19 at 11:03
  • Actually, I ordered the Pi without thinking much. Now, I want to use it as a development board for Micropython so that I can later use the code on another cheaper microcontroller for production. – Adarsha Jun 20 '19 at 11:19
  • It is ok for most parts but some modules and libraries on Micropython built for a specific board as some boards have more processing power or more options. So the network part is built for boards like esp that has internal network configuration, so you can't simulate that on a Pi. Micropython still hasn't such ability to cross-platform development. – Masoud Rahimi Jun 20 '19 at 11:23
  • Thank you @M.R. for your help. I believe I have to change to another language like Java. One question: Do you think that Java SE Embedded would be good for IoT? – Adarsha Jun 21 '19 at 05:13

0 Answers0