*Kufakwe kungobo yomlando* = Uyakha kanjani iseva yewebhu yokuphatha i-IoT = Sanibonani bafowethu, Ngiwuhlelo lokuzilibazisa futhi ngidinga iseluleko esincane Ukwenza kube mfushane: Ngifuna ukudala uhlelo lokusebenza oluncane lwewebhu ukuze ngilawule izibani zami ze-Philips Hue nezinye izinto ze-IoT ekhaya. Sengivele ngadlala nge-Hue API ePython futhi nginemibhalo embalwa esebenza kahle. Futhi nginemibhalo ethile esebenzisa imiyalo nge-SSH ngayinye kudivayisi ehlukile Ngakho njengesinyathelo sami esilandelayo ngifuna ukudala uhlelo lokusebenza lwewebhu ukuze lube ne-UI ebukekayo Esikhathini sami esidlule ngiphinde ngenza uhlelo lokusebenza oluncane lwe-Android, okokuqala e-Kotlin, ngase ku-Flutter naku-Firebase futhi ngamangala ukuthi ngingayithola kalula kanjani i-UI ebukeka kahle esebenza e-Flutter. Ngiyazi ukuthi iFlutter ingasetshenziswa futhi njengohlelo lokusebenza lwewebhu, kodwa angicabangi ukuthi leli ithuluzi elilungile lalokhu Ngabheka i-React ne-Angular futhi ngasebenzisa imihlahlandlela yabaqalayo. Uma kuqhathaniswa ne-Flutter zibukeka njengomsebenzi omningi wokuzenza zibukeke zizinhle, kodwa mhlawumbe ngidinga nje isifanekiso esingcono Emcabangweni wami ngingathanda ukuqalisa iskripthi esisodwa ukuze ngiqoqe isimo samanje, iskripthi sisibhala efayeleni elithile le-JSON futhi i-UI ikhombisa igrafu noma idayagramu enhle. Bese ucindezela inkinobho futhi lokhu kubhala elinye ifayela bese kushiswa iskripthi, esifunda ifayela futhi, masithi sishintsha umbala wokukhanya ngokufanele. Manje, ngilahlekelwe kancane ngokuthi yini okufanele ngiqale, uma ngikhuluma iqiniso Kulokho engikuqoqile ngingakwazi ukwakha isiphetho nge-Angular bese ngiba ne-MongoDB "njengesistimu yami yefayela"lapho ngingagcina futhi ngilayishe izibani zami noma imibhalo yokuhlela. Ngicabanga ukuthi ngizodinga i-API ukuze ngixhume i-DB ku-UI yami. Ngethemba ukuthi okungenani ngilungile ngokwengxenye :D Ungathi ukuqala nge-JS/TS nokudala i-UI nge-Angular noma i-React kuyisiqondiso esifanele? Noma ingabe lokhu akulungile ngokuphelele ngezinhloso zami? Siyabonga ngeseluleko sakho! Impela usendleleni elungile lapha, okuncane okushodayo ukukuhlanganisa konke kube isicaciso seseva. Engizokwenza esimweni sakho ukwakha iseva esebenzela ikhasi lewebhu. Ikhasi lewebhu lenza izicelo ze-HTTP zibuyele ku-REST API edalulwe yiseva. Iseva iyindawo yokuxhumana emaphakathi phakathi kwekhasi lakho lewebhu elisekupheleni, imibhalo yakho, i-DB yakho; ungazami futhi uxhume usuka ekhasini lewebhu uye ku-DB noma uguqule isimo sokukhanya ngaphandle kokudlula kuseva Chaza izindawo zakho zokugcina ze-API. Ake sithi ufuna ukulawula izibani zakho; mhlawumbe udinga: Thola ithokheni yokuqinisekisa [ I-HTTP GET/api/token with creds in header], returns token or 401 Get status of devices [ HTTP GET /api/devices with token in header], returns JSON status of all devices Get status of lights [ HTTP GET /api/devices/lights with token in header] returns JSON status of all lights Control a single light [ HTTP POST /api/light/ with token in header, payload specifying RGB], returns empty 200 on valid request, 422 otherwise And so forth. Once you have an API spec you can develop whatever you want to first; the server code for the API (Django is good if you're comfortable with Python), the front-end code, the server code for integrating your scripts or the DB. As long as the API is sufficiently specified then the parts will all talk to each other nicely. Separation of concerns makes it simple to build some bits, mock others up, modify and replace as needed A tip: don't write anything to files if you're just sending JSON data around. The server itself can *probably* just call all the script code directly with no need to pass files, and can definitely serve the JSON via HTTP to the web page for display purposes This sounds like a fun project. Can you tell me a little about your end goal with it? Maybe I’ll do something like it at my house. I guess what I’m wondering is aside from being a fun project, what (if any) controls does it give you over your devices that don’t come sort of “baked in” via remote controls or apps for example that may come with the device. Just would like to hear about your real world advantages of doing this == About Community == Members Online