can anyone tell me how to make library for any sensors

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
sepehr jami
Posts: 2
Joined: Wed Apr 06, 2022 4:58 am

can anyone tell me how to make library for any sensors

Post by sepehr jami » Wed Apr 06, 2022 5:08 am

hi. i just want to make library for some modules connected to esp32 via micropython.
i need to connect esp32 to Ethernet and couldn't find any library to do it.
so i guess i need to develop one
besides i use some libraries for temp and hum like aht10 and dht11 and I'm curious to know how exactly they work.
i googled it but couldn't find any useful explanation.
does anyone have any idea how to learn about how to make libraries for digital and analog modules? Any sources?
and I'm new to iot and micropython stuffs so need something for dummies i guess :)

tepalia02
Posts: 99
Joined: Mon Mar 21, 2022 5:13 am

Re: can anyone tell me how to make library for any sensors

Post by tepalia02 » Mon Jul 18, 2022 5:05 am

There is no straightforward tutorial. But I think it is possible to figure out if we study what's inside the existing micropython libraries.

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

Re: can anyone tell me how to make library for any sensors

Post by jimmo » Mon Jul 18, 2022 7:36 am

sepehr jami wrote:
Wed Apr 06, 2022 5:08 am
i need to connect esp32 to Ethernet and couldn't find any library to do it.
It does depend on which board and version you're using, but when supported you get a `network.LAN` class. https://docs.micropython.org/en/latest/ ... k.LAN.html
sepehr jami wrote:
Wed Apr 06, 2022 5:08 am
besides i use some libraries for temp and hum like aht10 and dht11 and I'm curious to know how exactly they work.
There's a dht11 driver built-in to MicroPython.

Are you asking how the driver works and how it's built in? Or how does the actual signalling to a dht11 module work?

For the former at least, see https://github.com/micropython/micropyt ... dht/dht.py and https://github.com/micropython/micropyt ... /dht/dht.c
sepehr jami wrote:
Wed Apr 06, 2022 5:08 am
does anyone have any idea how to learn about how to make libraries for digital and analog modules? Any sources?
This book might be helpful: https://www.oreilly.com/library/view/pr ... 491972724/

Post Reply