brainelectronics / micropython-modbus

MicroPython Modbus RTU Slave/Master and TCP Server/Slave library
GNU General Public License v3.0
104 stars 45 forks source link

I can't install the library. #85

Open AndreyVus opened 7 months ago

AndreyVus commented 7 months ago

Description

MicroPython ESP32_LoBo_v3.1.0 - 2017-01-03 on WROVER with ESP32

Type "help()" for more information.

import machine import network import time import upip upip.install('github:brainelectronics/micropython-modbus') Installing to: /lib/ Warning: pypi.python.org SSL certificate is not validated Error installing 'github:brainelectronics/micropython-modbus': Package not found, packages may be partially installed

Reproduction steps

I have Moduino MX4 ESP32 with Com, Eth, Wlan and Lte interfaces. Thonny:

boot.py: import network import time import machine import socket

def ethInit(): eth = network.LAN(mdc = machine.Pin(33), mdio = machine.Pin(18), power = None, phy_type = network.PHY_LAN8720, phy_addr = 0) eth.active(1) print("ETH ",end='') for i in range(10): print(".",end='') time.sleepms(500) if eth.isconnected(): for in range(30): time.sleep_ms(200) ifc = eth.ifconfig() print(ifc) if ifc[0] != "0.0.0.0" and ifc[3] != "0.0.0.0": print(' connected') return True break eth.active(0) print(' disconnected') return False def netTest(): s = socket.socket() ai = socket.getaddrinfo("google.com", 80) print("Address infos:", ai) addr = ai[0][-1] print("Connecting address:", addr) s.connect(addr) print("Connected. Sending request...") s.send(b"GET / HTTP/1.0\r\n\r\n") print("Sent OK, wating for answer...") rec = s.recv(10) print("Received: rec", rec) s.close() return rec == b'HTTP/1.1 2' try: if ethInit(): print(netTest()) except Exception as e: print(e)

install-modbus.py: import machine import network import time import upip upip.install('github:brainelectronics/micropython-modbus')

MicroPython version

ESP32_LoBo_v3.1.0 - 2017-01-03 on WROVER with ESP32

MicroPython board

other

MicroPython Modbus version

# e.g. v2.3.3
# use the following command to get the used version
import os
from umodbus import version
print('MicroPython infos:', os.uname())
print('Used micropthon-modbus version:', version.__version__))

Relevant log output

Installing to: /lib/
Warning: pypi.python.org SSL certificate is not validated
Error installing 'github:brainelectronics/micropython-modbus': Package not found, packages may be partially installed

User code

import machine
import network
import time
import upip
upip.install('github:brainelectronics/micropython-modbus')

Additional informations

No response

beyonlo commented 7 months ago

@AndreyVus please, try to download the lib and copy it manually (like as mpremote) to check if works.

brainelectronics commented 7 months ago

@AndreyVus you used upip but the mip install URL. Please use

import mip
mip.install('github:brainelectronics/micropython-modbus')

On Micropython systems with version 1.19.1 or older you can use upip

import upip
upip.install('micropython-modbus')