How to connect to WiFi and use the features (Expressions/Text2Speech)? HTTP API?
Hey @meganetaaan !
Although I googled my fingers off, I did not manage to connect the stack-chan to my WiFi. I looked also at the code (searched for SSID) but you created a really complex project that is a little bit hard to understand.
Dont get me wrong, I really like your project and would like to use and contribute to it....but it is lacking a guide on how to get started with extending or customizing the SW.
Thank you in advance for helping!
Yeah so few things documented... Current implementation needs two steps to connect WiFi.
- write down ssid and password settings to your
manifest_local.json
{
"config": {
"ssid": "your_ssid_here", // Note that the M5Stack can only connect to WiFi in the 2.4GHz band!
"password": "your_password_here",
"tts": {...},
"servo": {...}
}
}
- call
initNetworkfunction explicitly and use API inside its callback
An example using this function: https://github.com/meganetaaan/stack-chan/blob/0f94cdfe8d3133fb8304153465551bc9b1c4255c/firmware/mods/cheerup/mod.js#L114
import initNetwork from 'init-network'
// ...
initNetwork(() => {
callSomeAPI()
}
You can use any kind of network module like HTTP Server/Client as documented in the ModdableSDK repository.
I will update documentations of firmware.
I think forcing users to call initNetwork explicitly is annoying. So I'm planning to make API smarter.