Giter VIP home page Giter VIP logo

firmware's People

Contributors

annejan avatar basvs avatar codacy-badger avatar doebi avatar gavanfantom avatar igrr avatar klondi avatar krzychb avatar nlitsme avatar osresearch avatar peetz0r avatar projectgus avatar raboof avatar renzenicolai avatar roosted7 avatar sebastius avatar spritetm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

firmware's Issues

Skip frames when flushing

When flushing 3 times immediately after each other, the first flush will be instant, while the second 2 flushes will both take about 33 ticks.

Apparently flushing is somehow asynchronous. It would be neat if we could somehow detect the first flush is still in progress, and skip the second flush when the third flush comes in before the first flush has really finished.

BPP sleep

Revert sleep (1) to sleep (calcultated time)
Make sleep wake on touch!

Changing the display

I want to build one badge on my own, but I would like to use St7735 based display. Ugfx has a driver for it. What should I do to make it work? Should I edit the files in components\ugfx-glue?

Optimizing is needed?

23:46:55 <@tsd> we can still optimize a lot of things
23:47:15 <@tsd> .. we currently have 4 deflaters, 3 crc32 checksum methods, 3 adler32 checksum methods, etc, etc..

Freeing the HSPI bus breaks the VSPI config.

I've currently commented out this code in badge_leds_disable() to work around the problem. Definitely not the best solution, but now the code still seems to work. (I assume that the port is successfuly configured as GPIO INPUT port, but I am not sure..)

// FIXME: freeing the HSPI seems to (de)configure the VSPI as well..
// ret = spi_bus_free(HSPI_HOST);
// assert( ret == ESP_OK );

(I have mention the issue in issue #59 and/or pull-request #62)

Mass-flashing script

Should detect a badge being connected to one of the USB ports and flash it.

Should support flashing multiple badges in parallel.

V_bat is measured / displayed with +0.4V Offset

The Voltage of the battery is measured and displayed with an offset of +0.4V (values from multimeter: 3.8V badge: 4,2V). Therefore the battery indicator also shows a wrong status for the battery.

Only used one (my) badge for testing

bpp: replay issues between ed25519 and FEC layer

The authenticated message layer (ed25519) does not provide a proper secure channel. In particular, replay protection is left to the sequence numbering at the FEC layer. These sequence numbers, however, reset with the special "serial=0" packet which is used to change encoding parameters. This allows an attacker to replay older packets and confuse the update process in various ways.

For example, it implies that an erasure code is used on something that is not an erasure channel (where bits are only detectably dropped). Without further authentication, this allows an attacker to corrupt the firmware image during download by injecting an earlier packet with an appropriate sequence number.

In addition, since the code accepts any packet with a sequence number greater than the last, replaying an old high-numbered packet allows an attacker to cheaply block out the following legitimate packets.

Relatedly, a missed "serial=0" packet will leave a client decoder in a confused state until another "serial=0" is received.

'make' command ends with 2 errors

I'm trying to install badge emulator on OS X 10.11.6 using instruction from https://wiki.sha2017.org/w/Projects:Badge/Emulator#macOS and getting these errors:

../../ugfx/src/gos/gos_linux.c:108:16: error: use of undeclared identifier 'CLOCK_MONOTONIC'
        clock_gettime(CLOCK_MONOTONIC, &ts);
                      ^
../../ugfx/src/gos/gos_linux.c:211:20: error: use of undeclared identifier 'CLOCK_REALTIME'
                                        clock_gettime(CLOCK_REALTIME, &tm);

Emulator is missing librarys

It seems like the Emulator is missing Librarys. I tried to run my App, and it complains about the missing wifi module(using the network module seems to work though), and dialogs module.

Question: New distribution technique

In this post you are mentioning

Featuring a brand new distribution technique designed by Sprite_TM, we can update badges without associating to the WiFi access points.

Can you describe with technical details what is meant here?

Long app titles render wrongly

This is about the installer for the Hatchery.

For long app titles, two lines of text are rendered, but subsequently put in a one line high slot in the table of apps, showing half of each line.

For instance, category Utility contains on its first page the app "AltPWRLaptopCharger".

building on OSX

The toolchain from the xtensa-esp32-elf repository is for Linux only.

If you want to build on a mac, do the following:

  • download the mac toolchain from this page

  • rename the linux toolchain: mv xtensa-esp32-elf xtensa-esp32-elf-linux

  • untar the mac toolchain: tar zxf ~/Downloads/xtensa-esp32-elf-osx-1.22.0-61-gab8375a-5.2.0.tar.gz

  • install the CP2102 usbserial driver

  • then in the sdkconfig file change this line:
    CONFIG_ESPTOOLPY_PORT="/dev/tty.SLAB_USBtoUART"

Could use more dword-addressable memory.

Free up more 8-bit addressable memory.

Experimental, untested byte getter and setter methods:

uint8_t
u32_get_byte(uint8_t *ptr)
{
    intptr_t _ptr = (intptr_t) ptr;
    uint32_t *ptr_u32 = (uint32_t *) (_ptr & ~3);
    return (*ptr_u32 >> ((_ptr & 3) << 3)) & 0xff
}

void
u32_set_byte(uint8_t *ptr, uint8_t value)
{
    intptr_t _ptr = (intptr_t) ptr;
    uint32_t *ptr_u32 = (uint32_t *) (_ptr & ~3);
    uint32_t u32 = *ptr_u32;
    u32 &= ~( 0xff << ((_ptr & 3) << 3) );
    u32 |= value << ((_ptr & 3) << 3);
    *ptr_u32 = u32;
}   

bpp-recv/defec.c: null-pointer deref in defecInit()

if defecInit is called after defecRecv processed a parameter packet
(serial=0) that specifies an invalid decoder algorithm, the parameters are
already in savedStatus so a subsequent defecInit will attempt to restore
the decoder but yield NULL, leading to a crash in

      currDecoder->init(currK, currN, maxLen);

this can happen if an invalid parameter packet is received before the system
enters deep sleep (-> defecInit after wakeup).

likewise, if the decoder parameters (k/n) are invalid, the unchecked call above will fail and subsequent decoder calls will access uninitialized memory or reuse stale values.

Support for PL9823

Would be nice to have an option to use the badge to control PL9823 LED's, which are quite similar to the WS2812

Use nvs for configuration storage.

Currently stores in config.json via https://github.com/SHA2017-badge/micropython-esp32/blob/master/esp32/modules/database.py
Currently only stores name in https://badge.sha2017.org/files/521

Want to use NVS http://esp-idf.readthedocs.io/en/latest/api-reference/storage/nvs_flash.html

Current idea:

Start with 2 Namespaces badge and user

user will store name (and later more personal settings)

badge will store wifi.ssid, wifi.password and possibly type (like WPA2 ent etc)
badge can store mpr121.base.0 .. mpr121.base.7 too

TODO

  • badge_nvs component
  • move nvs_flash_init() to central badge_nvs_init() routine
  • include badge_nvs_init() in badge_init() (before configurable things like badge_mpr121_init())
  • micropython hooks for using it from there

Timeout on sdcard after sdcard-power-cycle

Current order:

  • enable power to sdcard
  • mount sdcard with esp_vfs_fat_sdmmc_mount()
  • read/write files
  • unmount sdcard with esp_vfs_fat_sdmmc_unmount()
  • disable power to sdcard

When doing a 2nd mount (power-on, mount, unmount, power-off, power-on, mount), the initialization fails with a timeout. It sounds like I have to initialize something extra.

SDCard Support

Why is there no SDCard Support?

import machine, sdcard, os
Traceback (most recent call last):
File "", line 1, in
ImportError: no module named 'sdcard'

Idea: Universal Badge Platform

There are multiple badges that run Micropython like the Tilda Mk. Pi and the SHA2017 badge. Since Micropython seems to work well enough to have the potential to be used in many more camp badges I propose that we define an API which would allow apps to work on all current and future Micropython based badges.

Another thing is the appstore. I think we've got that working great using Woezel. Backporting woezel to the Tilda Mk. Pi badge seems like a great way to improve that badge.

Also API calls to interact with for example LEDs, speakers, buzzers and buttons could be defined in such a way that an app would not have to be changed to work on different hardware.

Last thing: maybe it's an idea to create a sort-of descriptor so that an app (and the appstore) knows if certain hw features are available?

emulator build fails with current instructions

Simply following the instructions on the wiki in a fresh environment yields:

root@Junix-laptop:~/sha2017/Firmware/micropython/unix# make
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
mkdir -p build/genhdr
Generating build/genhdr/mpversion.h
GEN build/genhdr/qstr.i.last
In file included from ../py/../extmod/modussl_mbedtls.c:36:0:
./esp_log.h:8:23: fatal error: sdkconfig.h: No such file or directory
#include "sdkconfig.h"
                      ^
compilation terminated.
In file included from esp_log.c:5:0:
esp_log.h:8:23: fatal error: sdkconfig.h: No such file or directory
#include "sdkconfig.h"
                      ^
compilation terminated.
../py/mkrules.mk:73: recipe for target 'build/genhdr/qstr.i.last' failed
make: *** [build/genhdr/qstr.i.last] Error 1
make: *** Deleting file 'build/genhdr/qstr.i.last'

Update to esp-idf 3.0

Hi,

I am wondering if anybody succeeded using the SHA2017-badge/Firmware running on badge Rev1.0.* with the recent esp-idf (ESP-IDF Pre-release 3.0-rc1 as of today) and the updated toolchain (1.22.0-75-gbaf03c2-5.2.0).

To make the compilation complete I had to change WIFI_COUNTRY_EU to WIFI_COUNTRY_POLICY_AUTO in badge_first_run.c

Unfortunately the display does not work. The touch pad works. Setting Enable eink debug messages in menuconfig does not bring additional information:

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:0x3fff0018,len:4
load:0x3fff001c,len:4468
load:0x40078000,len:0
load:0x40078000,len:12976
entry 0x40078d88
D (157) badge_eink_dev: init called
D (157) badge_eink_dev: init done
badge_eink_dev: EPD-Busy Int up
Button START handling
Selected 'mpr121 touch demo'

Do you have any ideas where to look for possible issues with operation the the display?

My badge works without any issues loaded back with original firmware. Congratulations on building this impressive project complete with the hardware!

Prevent sleeping when connected to power

It would be nice if the badge stayed awake when connected to an external power source. It is a bit of a hassle trying to develop apps and upload to test when the badge falls asleep.

sha2017_ota.c: strncpy misuse (potential buffer overflow)

the line

  strncpy(dest, text + i, len);

would copy an HTTP response line of arbitrary length into the fixed-size buffer dest if it weren't for the saving fact that the text buffer is of the same size as dest. the length argument to strncpy should be the size of dest.

similarly in line 195:

  strncpy(dest, dest + 16, len - 17);

in addition, the behavior of strncpy is undefined for overlapping arguments.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.