So Easy MicroPython - LINE Notify
by Yungger Chen in Teachers > 5
1561 Views, 1 Favorites, 0 Comments
So Easy MicroPython - LINE Notify
*** Just add 2~3 lines, then your MCU will be an LINE Notifier enabled device ***
from My_NetHTTP_LINE import myNotify
line = myNotify(YOUR_LINE_NOTIFY_TOKEN)
line.send("Testing Message of LINE Notify !!")
***My_NetHTTP_LINE is a library to let your MCU send a message and image to your LINE App in very easy and fast way, just like the codes above. ***
*** Before next demonstration, you should have your account on the cloud platform, we will not take more time to introduce it step by step since anyone can easily get help from official website ***
Upload Libraries to MCU
First, You need to upload the libraries to you MCU board:
for MicroPython v1.19 and above:
- My_NetHTTP: A basic library for HTTP Restful API communication
- My_NetHTTP_LINE: A library for sending out message to LINE App
- My_Wifi: A basic library for WiFi connection (Optional, if your code already make the MCU connect to WiFi)
or MicroPython v1.18 and under:
*** If you have no idea how to upload File to your MCU, read my another article "So Easy MicroPython - ESP8266/ESP32 MCU File Management" first.
*** If you are interested in MyWifi library or no idea how to use it, read my another article "So Easy MicroPython - My WiFi Connection"
Example:Send Messages With Sticker to LINE Notify App
from My_Wifi import myWifi
from My_NetHTTP_LINE import myNotify
wifi = myWifi()
if wifi.connect(YOUR_WIFI_SSID, YOUR_WIFI_PSWD):
line = myNotify(YOUR_LINE_NOTIFY_TOKEN)
line.send("這是一則訊息測試")
line.send("This is a LINE Notify testing !!", package=1, sticker=103)
wifi.disconnect(3)
LINE Sticker List
As soon as you change the packageId and stickerId inside your code, and process it. The new sticker will deliver to your LINE notify app in no time。
To find the Package ID and Sticker ID, just go to official LINE website, there is a page of List of available stickers for your reference.
That's So Easy, Hope to Help a Little Bit !
Posted by Yungger
If it help you, and want to give some encouragement, just go HERE 😘 😘 !!