發表文章

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

firebase host 0: Arduino to firebase

圖片
I first got this lib: https://github.com/FirebaseExtended/firebase-arduino// But not working tested 2019/6/26 on esp8266 this is the working one https://github.com/mobizt/Firebase-ESP8266 there are different version for different board, such as esp32, arduino MKR1000wifi...etc Documentations are good, on dependencies, installation, feature....etc. Few thing need to be set up in google firebase and get the following info: data base host: https://**********.firebaseio.com/ this can be found in database Data, and select Realtime Database and you need a database secret form below: project overview/ project settings/Service accounts/Database secrets/ secret some thing like: fhWvKNxxxHb2oMmbF3sayyyE4HAhMxxzzzzSG53 the secret method seems to be an old one, and it could be replaced some day..... The only downside of this firebase lib is that it use arduino "String" in example... I tried to use arduinoJson lib....some arduino firebase lib already use Json lib, but

TTGO Lora32 V2 with 2 SPI

This is a very well made board, but as most of the boards from china, the document is always a pain... This board has Lora and SD slot, both are on different SPI...yes, esp32 has 2 SPIs. But arduino has SPI for one, the pins are defined in the HAL, so most libraries in arduino use the only one SPI. TTGO lora32 has SPI pins:         MISO   MOSI   SCK     CS SD    IO02    IO15     IO14    IO13 Lora IO19     IO27     IO05    IO18 According to: https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/peripherals/spi_master.html there are 4 SPIs on esp32, SPI0 and SPI1 are used for internal flash. HSPI/VSPI has 3 CS line each, to drive 3 devices each. TTGO does provide a lora example: https://github.com/LilyGO/TTGO-LORA32-V2.0 but TTGO does not provide the example on SD for LoraV2 board. but here:  https://github.com/LilyGO/TTGO-SD-test/blob/master/ESP32__goodSD/ESP32__goodSD.ino There is an example from Espressif about using 2SPI, HSPI/VSPI https://github.co

氣象開放資料平台 潮汐 to google calendar

I wish to make a google calendar for tidal info of certain location, so that I can open google calendar and have the time of high tie of several weekends. for example: 淡水的 high tie 時間 this weekend. There are few steps: Getting data: different sources comes with different numbers of data and different format.....(why?) method1: 政府資料開放平臺   it's a JSON file 潮汐預報-未來1個月潮汐預報 https://data.gov.tw/dataset/7038 潮汐表-明年高低潮時潮高預報(every Oct) https://data.gov.tw/dataset/9205   this one contains less locations, for 2019 data, it's 42 locations.   中央氣象局開放資料平臺之資料擷取API : can be json or xml you need to first get an account and get a key(valid for a year.) 未來1個月潮汐預報  (no whole year one) it contain lot of locations,about 210 locations. location table is here: https://opendata.cwb.gov.tw/opendatadoc/MMC/A0021-001.pdf   I tried the key I found in 政府資料開放平台 some times it works fine...(rdec-key-123-45678-011121314) Deal with JSON file 這兩種 data的包裝方法完全不同, 資料的密度也完全不同... 我