• MicroPython
    2 min | 5531

    #MicroPython: Weather Report Box

    MicroPython | 2 min | 5531


    Hi again!... First of all:

    Happy Chinese New Year!!!

    I've just uploaded some code for the Wipy 2.0. I wanted to write some python code. That was why I took the Wipy 2.0 and programmed something like a weather report box. In this project the Wipy 2.0 reads the GPS coordinates via UART, then makes a web get request using the API of openweathermap, and after that the results are displayed on a LCD.

    If you like this, please leave a comment, share and/or like! It would be very much appreciated!

    PythonCode: https://goo.gl/v7NCkj

    Things used in this project

    Hardware components

    (*) For this project I used the Ublox NEO-6M but you should probably buy the new NEO-M8N (see here)

    Software apps and online services:

    Wiring

    Wipy 2.0NEO-6MST7735
    3.3vVCCVCC
    GNDGNDGND
    P3(G12)RX
    P4(G11)TX
    P6(G13)RES
    P7(G14)RS/DC
    P8(G15)CS
    P10(G17)SCL
    P11(G22)SDA

    These are the default connection setting, you can change them using the constructor of the Display class as

    my_display = Display(self, uSPI=0, pinDC='P7', pinCS='P8', pinRST='P6')   

    Instructions

    1. Download the complete Github repository
    2. Update your Wipy firmware
    3. Register on Open Weather Map Open Weather Map API to get an API key.
    4. Connect the GPS module and the ST7735 display as indicated in the Wiring section.
    5. Modify the boot.py file to enter your SSID and WPA password.
      • Note: the firmware (1.5.0.b2 and I think early versions too) has a bug and the DNS server is not set if you use static IP address and this is needed to resolve the get request.
    6. Modify the main.py file to include your API key: API variable under updatingWeather(self, my_gps, my_display) method -line 40-.
    7. Optional: change the GPS and Weather update rates in milliseconds in the main.py file:
      • UPDATE_GPS = const(10000) (default = 10 seconds)
      • UPDATE_WEATHER = const(50000) (default = 50 seconds)
    8. Copy the all the files to the flash memory of the Wipy 2.0 and restart the board.

    Preview

    Changelog

    • Revision 0.1b

    Credits


    Comments

    Empty