發表文章

目前顯示的是 7月, 2019的文章

orange internal module with telemetry firmware upgrade DSM

圖片
I have a 9XR Pro the first module I use is a PPM base DSM module: this module support 4 types of DSM protocol, it would auto select when binding with receiver, but if you switch planes between different type DSM, you need to select the binded one, by quick pressing bind key 3 times. The I saw this module using internal antenna of 9XR Pro, I took it. This modele take me few search to bind, and ran into problems with some DSMX receiver.  refer to  https://ldsrc.blogspot.com/2018/06/orange-dsm2dsmx-tx-modules-how-to-make.html I did met lot of trouble, and I found this: Orange Module running MULTI protocol it seems the default firmware of the module has some issue. need to be updated. Mike has this module and 9XR PRO, he wrote a bootloader for the module, there is a Xmega in the module, so the fist step is to use an arduino pro mini (must be a 3.3V one, 16Mhz or 8Mhz should not matter, I use 16Mhz 3.3V 328), this require some wire wedding between the module and the pro m

firebase host 5: query data and showing a json in body

圖片
There are ways to search in firebase: https://firebase.google.com/docs/reference/js/firebase.database.Query Methods end At equal To is Equal limit ToFirst limit ToLast off on once order ByChild order ByKey order ByPriority order ByValue start At toJSON to String I plan to use web to show my sensor data, so the last data and last few data average are useful and to show the returned val in HTML body, you need to use JSON.stringify example as below: < script > var db = firebase . database (); db . ref ( "chinese/henry" ). limitToLast ( 3 ). on ( 'value' , function ( snapshot ) { //db.ref("chinese/henry").limitToFirst(1).once('value', function (snapshot) { //db.ref("chinese/henry").on('value', function (snapshot) { var data = snapshot . val (); console . log ( data ); console . log ( snapshot . key ); // it shows henry document . getElementById ( "mydata

firebase host 4: write/read from web

圖片
Since setting up the firebase, I was searching lot of examples of read/write data from web with HTML and js... bot none works for me. I think the version changment is also a cause, but not sure where are the differences. the version of firebase lib I used no is 6.2.4 and the examples are mostly 5.x.x, the version change also impact other java lib version and support. after several fail, I decide to search most recent one. 26 Day26 前端福音(1/4): Firebase-介紹 & 建立專案 27 Day27 前端福音(2/4): Firebase-寫入&刪除資料 28 Day28 前端福音(3/4): Firebase-讀取資料 29 Day29 前端福音(4/4): Firebase-帳號系統&資料讀寫規則 But still, I need to modify some thing, When you setup your firebase app and realtime, it will give you some setting to add at the end of body of your html, I need to add the 2nd one, the firebase-database.js, other when you do var db = firebase . database (); it will give you an error. < script src = "https://www.gstatic.com/firebasejs/6.2.4/firebase-app.js" &g

firebase host 3 : realtime update

I have done arduino data upload to firebase realtime, and trying to figure out how the data can be read and updated from other sites, such as a web server. The method used by firebase is web socket, so you can issue a http request with the key and get the value, of course the return will be a json. you will able to add, or set data as well as read. which means beside reading value and post on website, you can also set the data, to turn on or off something. since it's a socket, you can also get update from firebase once there is a child add, or child change. reference: This one gives a complete demo from DHT sensor to firebase hosting website showing temp and humidity. https://www.freecodecamp.org/news/iot-prototyping-with-firebase-doing-more-with-less-2f5c746dac8b/ This one use website to control chrismas lights. https://medium.com/firebase-developers/using-firebase-to-control-your-arduino-project-over-the-web-ba94569d172c

firebase host 2:log in , init, deploy

圖片
After installing firebase CLI tool(I believe they will come out with better GUI version) I refer to this doc: https://medium.com/@aleemuddin13/how-to-host-static-website-on-firebase-hosting-for-free-9de8917bebf2 you first create a dir where you store your project(I already created a firebase project), cd into your dir, and start with: firebase login it will show up a google login web page, and you can log in with it. then, continue with: firebase init move with up/down and select with space, then press enter, select hosting then CLI will ask you to select project, public directory, single page app or not, then it will creat 2 html files in /public when things are done, you can use firebase serve to preview the pages locally... open your browser: you will see the page.. then use: firebase deploy to upload to firebase then you have 2 links: Project Console: https://console.firebase.google.com/project/fbasedht11/overview Hosting URL: https://fbasedht11.fir

firebase host 1: Install nodejs and npm on ubuntu

圖片
to use firebase host, you will need to install firebase tools, which need to install nodejs and npm I installed modejs without issue, but I got problem on npm, below is how I installed npm and firebase tools.. sudo apt-get install nodejs-dev node-gyp libssl1.0-dev sudo apt-get install npm check version: henry@henry-i7:~$ npm -v 3.5.2 sudo npm install -g firebase-tools