Como actualizar DVmega con Raspberry Pi y Pi-Star

Antes de comenzar con la actualización es necesario realizar una pequeña modificación en la placa DVmega, instalar un puente entre un pin del conector y un contacto del condensador C45.

Una vez hecho el puente es recomendable volver a conectar la placa a la Raspberry y comprobar que todo funciona correctamente. Si todo arranca con normalidad podemos pasar a la actualización en sí.

Para ejecutar la actualización es necesario conectarse mediante ssh a la Raspberry, para ello podemos utilizar Putty. Una vez conectados lo primero que debemos hacer es poner el sistema de archivos en modo lectura-escritura:

 pi-star@pi-star:~$ rpi-rw

Nos movemos al directorio temporal

pi-star@pi-star(rw):~$ cd /tmp

Descargamos las herramientas necesarias para la actualización.

pi-star@pi-star(rw):tmp$ wget http://www.pistar.uk/downloads/dvmega-flash-tools.zip
--2020-01-25 00:41:00--  http://www.pistar.uk/downloads/dvmega-flash-tools.zip
Resolving www.pistar.uk (www.pistar.uk)... 104.27.185.136, 104.27.184.136, 2606:4700:3035::681b:b988, ...
Connecting to www.pistar.uk (www.pistar.uk)|104.27.185.136|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 954 [application/zip]
Saving to: dvmega-flash-tools.zip


dvmega-flash-tools.   0%[                      ]       0  --.-KB/s             
dvmega-flash-tools. 100%[=====================>]     954  --.-KB/s   in 0s     

2020-01-25 00:41:00 (24.6 MB/s) - dvmega-flash-tools.zip saved [954/954]

Descargamos el firmware, en este caso la versión 3.26

pi-star@pi-star(rw):tmp$ wget http://www.dvmega.auria.nl/images/DVMEGA_RH_V326_UNO.zip
--2020-01-25 00:43:52--  http://www.dvmega.auria.nl/images/DVMEGA_RH_V326_UNO.zip
Resolving www.dvmega.auria.nl (www.dvmega.auria.nl)... 185.27.142.205
Connecting to www.dvmega.auria.nl (www.dvmega.auria.nl)|185.27.142.205|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 50117 (49K) [application/zip]
Saving to: DVMEGA_RH_V326_UNO.zip


DVMEGA_RH_V326_UNO.   0%[                      ]       0  --.-KB/s             
DVMEGA_RH_V326_UNO. 100%[=====================>]  48.94K   267KB/s   in 0.2s   

2020-01-25 00:43:56 (267 KB/s) - DVMEGA_RH_V326_UNO.zip saved [50117/50117]

Descomprimimos los archivos de herramientas y firmware en el directorio dvmega.

pi-star@pi-star(rw):tmp$ unzip -d dvmega dvmegaunzip -d dvmega dvmega-flash-tools.zip
Archive:  dvmega-flash-tools.zip
  inflating: dvmega/flash_gpio.sh    
  inflating: dvmega/flash_usb.sh     
pi-star@pi-star(rw):tmp$ unzip -j -d dvmega DVMEGA_RH_V319_UNO.zip_UNO.zip_UNO.zip2_UNO.zip6_UNO.zip
Archive:  DVMEGA_RH_V326_UNO.zip
  inflating: dvmega/Changelog.txt    
  inflating: dvmega/DVMEGA_RH_V326_UNO.hex  
  inflating: dvmega/DVMEGA_RH_V326_UNO_JAPAN.hex  

No movemos al directorio dvmega y comprobamos que estan todos los ficheros necesarios, herramientas y la nueva version de firmware.

pi-star@pi-star(rw):tmp$ cd dvmega/
pi-star@pi-star(rw):dvmega$ ls
Changelog.txt           DVMEGA_RH_V326_UNO_JAPAN.hex  flash_usb.sh
DVMEGA_RH_V326_UNO.hex  flash_gpio.sh

Comprobamos que el fichero comprimido incluye la versión para Japón, que no necesitamos, y la eliminamos.

pi-star@pi-star(rw):dvmega$ rm dDVMEGA_RH_V326_UNO_JAPAN.hex 

A continuación ejecutamos la actualización.

pi-star@pi-star(rw):dvmega$ sudo ./flash_gpio.sh
Warning: Stopping pistar-watchdog.service, but it can still be activated by:
  pistar-watchdog.timer
Warning: Stopping dstarrepeater.service, but it can still be activated by:
  dstarrepeater.timer
Found DVMEGA_RH_V326_UNO.hex firmware...

avrdude-original: Version 6.1, compiled on Jul  7 2015 at 10:29:47
                  Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
                  Copyright (c) 2007-2014 Joerg Wunsch

                  System wide configuration file is "/etc/avrdude.conf"
                  User configuration file is "/root/.avrduderc"
                  User configuration file does not exist or is not a regular file, skipping

                  Using Port                    : /dev/ttyAMA0
                  Using Programmer              : arduino
                  Overriding Baud Rate          : 115200
avrdude-original: Using autoreset DTR on GPIO Pin 7
                  AVR Part                      : ATmega328P
                  Chip Erase delay              : 9000 us
                  PAGEL                         : PD7
                  BS2                           : PC2
                  RESET disposition             : dedicated
                  RETRY pulse                   : SCK
                  serial program mode           : yes
                  parallel program mode         : yes
                  Timeout                       : 200
                  StabDelay                     : 100
                  CmdexeDelay                   : 25
                  SyncLoops                     : 32
                  ByteDelay                     : 0
                  PollIndex                     : 3
                  PollValue                     : 0x53
                  Memory Detail                 :

                                           Block Poll               Page                       Polled
                    Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
                    ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
                    eeprom        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
                    flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
                    lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                    hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                    efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                    lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                    calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
                    signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

                  Programmer Type : Arduino
                  Description     : Arduino
                  Hardware Version: 3
                  Firmware Version: 4.4
                  Vtarget         : 0.3 V
                  Varef           : 0.3 V
                  Oscillator      : 28.800 kHz
                  SCK period      : 3.3 us

avrdude-original: AVR device initialized and ready to accept instructions


Reading |                                                    | 0% 0.00s
Reading | ################################################## | 100% 0.00s

avrdude-original: Device signature = 0x1e950f
avrdude-original: safemode: lfuse reads as 0
avrdude-original: safemode: hfuse reads as 0
avrdude-original: safemode: efuse reads as 0
avrdude-original: NOTE: "flash" memory has been specified, an erase cycle will be performed
                  To disable this feature, specify the -D option.
avrdude-original: erasing chip
avrdude-original: reading input file "DVMEGA_RH_V326_UNO.hex"
avrdude-original: input file DVMEGA_RH_V326_UNO.hex auto detected as Intel Hex
avrdude-original: writing flash (29546 bytes):


Writing |                                                    | 0% 0.00s
Writing | ################################################## | 100% 4.18s

avrdude-original: 29546 bytes of flash written
avrdude-original: verifying flash memory against DVMEGA_RH_V326_UNO.hex:
avrdude-original: load data flash data from input file DVMEGA_RH_V326_UNO.hex:
avrdude-original: input file DVMEGA_RH_V326_UNO.hex auto detected as Intel Hex
avrdude-original: input file DVMEGA_RH_V326_UNO.hex contains 29546 bytes
avrdude-original: reading on-chip flash data:


Reading |                                                    | 0% 0.00s
Reading | ################################################## | 100% 3.12s

avrdude-original: verifying ...
avrdude-original: 29546 bytes of flash verified

avrdude-original: safemode: lfuse reads as 0
avrdude-original: safemode: hfuse reads as 0
avrdude-original: safemode: efuse reads as 0
avrdude-original: safemode: Fuses OK (E:00, H:00, L:00)
strace: |autoreset: Broken pipe
strace: |autoreset: Broken pipe
strace: |autoreset: Broken pipe
strace: |autoreset: Broken pipe
strace: |autoreset: Broken pipe

avrdude-original done.  Thank you.

strace: |autoreset: Broken pipe
Once flashing has been completed, you should reboot your Pi-Star

Finalizada la actualización, reiniciamos la Raspberry.

pi-star@pi-star(rw):dvmega$ sudo reboot
Broadcast message from pi-star@pi-star on pts/0 (Sat 2020-01-25 00:47:07 CET):
The system is going down for reboot NOW! 

Comprobamos que se ha cargado correctamente la nueva versión.

Ya solo queda disfrutar de la radio!

Deja un comentario