eni23 / micronova-controller

This repo contains documentation and code to interface with pellet stoves based on Micronova controllers
GNU General Public License v3.0
16 stars 4 forks source link

How to write in ram form web adress? #11

Closed TTHOMAS52 closed 8 months ago

TTHOMAS52 commented 9 months ago

Hello, the ip of my esp32 is 192.168.0.25. I can read the value in ram or eeprom (http:\192.168.0.25/api/ram?addr=36 it's the adress for temperature needed ) But how can write to ram or eeprom to change a value I try "http:\192.168.0.25/api/ram?addr=36 ?value=50" "http:\192.168.0.25/api/ram?addr=36&?value=50" ... thanks

eni23 commented 9 months ago

@TTHOMAS52

In order to write to an adress over HTTP, you need to use a POST request. The example you did only creates a GET-Request and thus not gonna work.

You need a tool like curl or something like that, a entering a URL to the browser is not gonna work.

TTHOMAS52 commented 8 months ago

this is the solution:

curl 'http://ip..../api/ram' -X POST -H 'Content-Type: application/x-www-form-urlencoded;charset=UTF-8' --data-raw 'addr=0x21&value=32'

curl 'http://192.168.1.8/api/eeprom' -X POST -H 'Content-Type: application/x-www-form-urlencoded;charset=UTF-8' --data-raw 'addr=0x21&value=32'