Software/Python

MicroPython 에서 ESP-NOW 지원

초인로크 2024. 3. 2. 17:38
반응형

MicroPython의 홈페이지에서 ESP-NOW를 지원한다는 내용과 샘플코드가 담겨있다.

 

 

 

espnow — support for the ESP-NOW wireless protocol — MicroPython latest documentation

© Copyright - The MicroPython Documentation is Copyright © 2014-2023, Damien P. George, Paul Sokolovsky, and contributors. Last updated on 01 Mar 2024.

docs.micropython.org

 

 

홈페이지에 있는 Sender 와 Receiver의 소스를 각각의 ESP32에 업로드 한 뒤에

 

Receiver를 확인하면 아래와 같이 바이너리 데이터를 수신하는 것을 확인할 수 있다.

 

 

17:31:15.776 -> b'\xa8B\xe3\x9e\xac<' b'Starting...'
17:31:15.776 -> b'\xa8B\xe3\x9e\xac<' b'00000000000000000000'
17:31:15.776 -> b'\xa8B\xe3\x9e\xac<' b'11111111111111111111'
17:31:15.807 -> b'\xa8B\xe3\x9e\xac<' b'22222222222222222222'
17:31:15.807 -> b'\xa8B\xe3\x9e\xac<' b'33333333333333333333'
17:31:15.807 -> b'\xa8B\xe3\x9e\xac<' b'44444444444444444444'
17:31:15.807 -> b'\xa8B\xe3\x9e\xac<' b'55555555555555555555'
17:31:15.807 -> b'\xa8B\xe3\x9e\xac<' b'66666666666666666666'
17:31:15.807 -> b'\xa8B\xe3\x9e\xac<' b'77777777777777777777'
17:31:15.807 -> b'\xa8B\xe3\x9e\xac<' b'88888888888888888888'
17:31:15.807 -> b'\xa8B\xe3\x9e\xac<' b'99999999999999999999'
17:31:15.807 -> b'\xa8B\xe3\x9e\xac<' b'1010101010101010101010101010101010101010'
17:31:15.839 -> b'\xa8B\xe3\x9e\xac<' b'1111111111111111111111111111111111111111'
17:31:15.839 -> b'\xa8B\xe3\x9e\xac<' b'1212121212121212121212121212121212121212'
17:31:15.839 -> b'\xa8B\xe3\x9e\xac<' b'1313131313131313131313131313131313131313'
17:31:15.839 -> b'\xa8B\xe3\x9e\xac<' b'1414141414141414141414141414141414141414'
17:31:15.839 -> b'\xa8B\xe3\x9e\xac<' b'1515151515151515151515151515151515151515'
17:31:15.870 -> b'\xa8B\xe3\x9e\xac<' b'1717171717171717171717171717171717171717'
17:31:15.870 -> b'\xa8B\xe3\x9e\xac<' b'1818181818181818181818181818181818181818'
17:31:15.870 -> b'\xa8B\xe3\x9e\xac<' b'2222222222222222222222222222222222222222'
17:31:15.870 -> b'\xa8B\xe3\x9e\xac<' b'2727272727272727272727272727272727272727'
17:31:15.870 -> b'\xa8B\xe3\x9e\xac<' b'2828282828282828282828282828282828282828'
17:31:15.870 -> b'\xa8B\xe3\x9e\xac<' b'3131313131313131313131313131313131313131'
17:31:15.902 -> b'\xa8B\xe3\x9e\xac<' b'3535353535353535353535353535353535353535'
17:31:15.902 -> b'\xa8B\xe3\x9e\xac<' b'3636363636363636363636363636363636363636'
17:31:15.902 -> b'\xa8B\xe3\x9e\xac<' b'4040404040404040404040404040404040404040'
17:31:15.902 -> b'\xa8B\xe3\x9e\xac<' b'4141414141414141414141414141414141414141'
17:31:15.902 -> b'\xa8B\xe3\x9e\xac<' b'4444444444444444444444444444444444444444'
17:31:15.935 -> b'\xa8B\xe3\x9e\xac<' b'4545454545454545454545454545454545454545'
17:31:15.935 -> b'\xa8B\xe3\x9e\xac<' b'4747474747474747474747474747474747474747'
17:31:15.935 -> b'\xa8B\xe3\x9e\xac<' b'5353535353535353535353535353535353535353'
17:31:15.935 -> b'\xa8B\xe3\x9e\xac<' b'5454545454545454545454545454545454545454'
17:31:15.935 -> b'\xa8B\xe3\x9e\xac<' b'5959595959595959595959595959595959595959'
17:31:15.935 -> b'\xa8B\xe3\x9e\xac<' b'6060606060606060606060606060606060606060'
17:31:15.968 -> b'\xa8B\xe3\x9e\xac<' b'6464646464646464646464646464646464646464'
17:31:15.968 -> b'\xa8B\xe3\x9e\xac<' b'6565656565656565656565656565656565656565'
17:31:15.968 -> b'\xa8B\xe3\x9e\xac<' b'7070707070707070707070707070707070707070'
17:31:15.968 -> b'\xa8B\xe3\x9e\xac<' b'7575757575757575757575757575757575757575'
17:31:15.968 -> b'\xa8B\xe3\x9e\xac<' b'7676767676767676767676767676767676767676'
17:31:16.000 -> b'\xa8B\xe3\x9e\xac<' b'8080808080808080808080808080808080808080'
17:31:16.000 -> b'\xa8B\xe3\x9e\xac<' b'8181818181818181818181818181818181818181'
17:31:16.000 -> b'\xa8B\xe3\x9e\xac<' b'8484848484848484848484848484848484848484'
17:31:16.000 -> b'\xa8B\xe3\x9e\xac<' b'8585858585858585858585858585858585858585'
17:31:16.000 -> b'\xa8B\xe3\x9e\xac<' b'8989898989898989898989898989898989898989'
17:31:16.000 -> b'\xa8B\xe3\x9e\xac<' b'9393939393939393939393939393939393939393'
17:31:16.035 -> b'\xa8B\xe3\x9e\xac<' b'9494949494949494949494949494949494949494'
17:31:16.035 -> b'\xa8B\xe3\x9e\xac<' b'9595959595959595959595959595959595959595'
17:31:16.035 -> b'\xa8B\xe3\x9e\xac<' b'9696969696969696969696969696969696969696'
17:31:16.035 -> b'\xa8B\xe3\x9e\xac<' b'9999999999999999999999999999999999999999'
17:31:16.035 -> b'\xa8B\xe3\x9e\xac<' b'end'
17:31:16.035 -> MicroPython v1.22.2 on 2024-02-22; Generic ESP32 module with ESP32
17:31:16.067 -> Type "help()" for more information.

 

 

마이크로 컨트롤러를 이용하여 파이썬을 재미있게 공부 할 수 있을 것 같네.

 

 

반응형