skot / ESP-Miner

A bitcoin ASIC miner for the ESP32
GNU General Public License v3.0
325 stars 119 forks source link

Gamma: Webserver crash after extensive API calls #356

Open jrkalf opened 2 days ago

jrkalf commented 2 days ago

I use home assistant with a restful sensor to query the api/system/info to obtain statistics. After doing several requests, I’ve not measured the exact number, the webservice becomes unavailable. The unit does remain online and mining (according to the pool stats), but the webservice and api are unreachable.

To Reproduce Steps to reproduce the behavior:

  1. start machine as usual
  2. Do extensive API polling on api/system/info
  3. Experience webservice to be unresponsibe
  4. See error

Hardware (please complete the following information):

Additional context HomeAssistant polling method:

- platform: rest
    unit_of_measurement: Gh/s
    resource: !secret bitaxe_ip
    method: GET
    value_template: '{{ value_json.hashRate }}'
    name: Bitaxe hashrate
    scan_interval: 15

  - platform: rest
    unit_of_measurement: °C
    resource: !secret bitaxe_ip
    method: GET
    name: Bitaxe temp
    value_template: '{{ value_json.temp }}'
    scan_interval: 60

  - platform: rest
    unit_of_measurement: sec
    resource: !secret bitaxe_ip
    method: GET
    name: Bitaxe up-time
    value_template: '{{ value_json.uptimeSeconds }}'
    scan_interval: 60

and bitaxe_ip in the secrets.yaml points to http://ip-address/api/system/info

skot commented 2 days ago

Can you monitor the free heap memory on the Bitaxe while you do this? It's available in the Overview section on the AxeOS Logs tab.

I'm curious if we're leaking memory somewhere.