FiPy as Gateway



  • Hello all,
    Initially I have registered my FiPy as a device and Dragino LG-01 as Gateway. Dragino was shown not connected on TTN. I checked the configuration many times, but it didnot work.
    So I wanted to check if its the issue withe Gateway or Server. So now, I registered the same FiPy as Gateway. This is the result I got on minicom.

    configsip: 0, SPIWP:0xee                                                        
    clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00         
    mode:DIO, clock div:1                                                           
    load:0x3fff8028,len:8                                                           
    load:0x3fff8030,len:1728                                                        
    load:0x4009fa00,len:0                                                           
    load:0x4009fa00,len:14584                                                       
    entry 0x400a059c                                                                
    �ets Jun  8 2016 00:22:57                                                       
                                                                                    
    rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)                         
    configsip: 0, SPIWP:0xee                                                        
    clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00         
    mode:DIO, clock div:1                                                           
    load:0x3fff8028,len:8                                                           
    load:0x3fff8030,len:1728                                                        
    load:0x4009fa00,len:0                                                           
    load:0x4009fa00,len:14584                                                       
    entry 0x400a059c                                                                
    �ets Jun  8 2016 00:22:57                                                       
                                                                                    
    rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)                         
    configsip: 0, SPIWP:0xee                                                        
    clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00         
    mode:DIO, clock div:1                                                           
    load:0x3fff8028,len:8                                                           
    load:0x3fff8030,len:1728                                                        
    load:0x4009fa00,len:0                                                           
    load:0x4009fa00,len:14584                                                       
    entry 0x400a059c  
    

    I trasferred main.py and config.py to /flash folder and nanogateway.py to /flash/lib/ folder. Then I did factory reset as I could not find Wifi access point. deleted the nanogateway.py from libraries and put that file along with main.py in falsh folder.
    The device does not enter REPL mode at all.

    Can one anyone suggest what would have gone wrong.
    Can I delete the device registration of FiPy from TTN


  • administrators

    @amket Thanks for the feedback, I'll look into adding some output such as "Connecting to Wifi network..." to make it more clear what is happening.



  • Sorry for the inconvinience. I did not notice it earlier. It is taking time to connect to wifi so it takes time to enter REPL.



  • This post is deleted!


  • @xykon I did it over FTP on Terminal(ubuntu) .

    usr@usr-ThinkPad-T460s:~$ ftp 192.168.4.1
    Connected to 192.168.4.1.
    220 Micropython FTP Server
    Name (192.168.4.1:amulya): micro
    331 
    Password:
    230 
    Remote system type is UNIX.
    Using binary mode to transfer files.
    ftp> passive
    Passive mode on.
    ftp> bin
    200 
    ftp> cd /flash
    250 
    ftp> put nanogateway.py
    local: nanogateway.py remote: nanogateway.py
    227 (192,168,4,1,7,232)
    150 
    226 
    8859 bytes sent in 0.00 secs (67.5888 MB/s)
    ftp> ls
    227 (192,168,4,1,7,232)
    150 
    -rw-rw-r--   1 root  root       506 Jan  1 00:01 main.py
    drw-rw-r--   1 root  root         0 Jan  1 00:00 sys
    drw-rw-r--   1 root  root         0 Jan  1 00:00 lib
    drw-rw-r--   1 root  root         0 Jan  1 00:00 cert
    -rw-rw-r--   1 root  root         0 Jan  1 00:00 boot.py
    -rw-rw-r--   1 root  root       571 Jan  1 00:01 config.py
    -rw-rw-r--   1 root  root      8859 Jan  1 00:01 nanogateway.py
    226 
    ftp>
    

    I should also mention, after I wrote you a reply, I thought of adding another antenna for wifi and check, I am not very sure if thats the reason but it seemed to work . It entered REPL mode.

    But it wasn't consistent. It breaks and enters REPL.
    CAn you tell me if there is anything to do with Wifi connection


  • administrators

    @amket How are you uploading the files?



  • This is what the result look like

    configsip: 0, SPIWP:0xee
    clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
    mode:DIO, clock div:1
    load:0x3fff8028,len:8
    load:0x3fff8030,len:1728
    load:0x4009fa00,len:0
    load:0x4009fa00,len:14584
    entry 0x400a059c
    ?ets Jun  8 2016 00:22:57
    
    rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
    configsip: 0, SPIWP:0xee
    clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
    mode:DIO, clock div?????????Ғ??Ҫ???UI=9}IMQ????5Յ}     JJC??Vp: 0, SPIWP:0xee
    clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
    mode:DIO, clock div:1
    load:0x3fff8028,len:8
    load:0x3fff8030,len:1728
    load:0x4009fa00,len:0
    load:0x4009fa00,len:14584
    entry 0x400a059c
    ets???? 00:22:57
    ??ᗼLB?=]I=9}IMQ?,boot:0x13 (SPI_FAST_FLASH_BOOT)
    configsip: 0, SPIWP:0xee
    clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
    mode:DIO, clock div:1
    load:0x3fff8028,len:8
    load:0x3fff8030,len:1728
    load:0x4009fa00,len:0
    load:0x4009fa00,len:14584
    entry 0x400a059c
    ?E (414) esp_image: Checksum failed. Calculated 0xbb read 0xa8
    


  • Hi ,
    @Xykon I did do what have been mention by you. The result is the same. My device doenot enter REPL at all.


  • administrators

    @amket The whole process is explained in https://docs.pycom.io/chapter/tutorials/lora/lorawan-nano-gateway.html

    For the nano gateway the files are main.py, config.py and nanogateway.py all of which should be uploaded to the /flash folder on the device after making the necessary modifications.



  • Hello @Xykon ,
    I wanted to delete the application, I did it.
    I did update the device with firmware making sure to erase the flash file.

    Just wanted to confirm, which of the files from the link you mentioned above, I should be uploading to get my device working as nano gateway.

    Sorry the question might seem lame, but just dont want the FiPy to stop working


  • administrators

    @amket Not sure what went wrong but I suggest re-flashing the device with the firmware updater and selecting the option "Erase flash file system" in the Communication window. This will make sure all custom scripts are erased from the device.

    Did you use the code from https://github.com/pycom/pycom-libraries/tree/master/examples/lorawan-nano-gateway

    You should be able to delete your gateway in the TTN console by choosing settings and using the "Delete gateway ...." link at the bottom.


Log in to reply
 

Pycom on Twitter