Could anyone help with how to download the current setting file and upload the modified setting file?
I read from Ruuvi documentation that Ruuvi Gateway is configured by gw_cfg_default.json. This file could be read/write to by HTTP. However, the documentation does not tell to what address/location/URL to send or query the json file. Could anyone help?
The remote configuration through JSON is a feature that weāll introduce in v1.12 release. Weāre currently testing a release candidate and are aiming to release the update in September. You can install the development releases in GUI by using Artifacts of ruuvi_gateway_esp-PR #717 : /build [Jenkins] as the update URL.
The configuration supports both Gateway-specific and general configuration,
If you specify a folder name, it will first attempt to read the configuration file for this Gateway from <GW_MAC>.json (for example, AABBCCDDEEFF.json). If that file fails, an attempt will be made to read the overall configuration from gw_cfg.json.
Also, the configuration file can be generated dynamically by the server, for this the server must analyze the HTTP header 'ruuvi_gw_mac', which contains MAC address in the format XX:XX:XX:XX:XX:XX.
Server to download configuration from is defined in this screen after firmware update:
Great, thanks a lot for your help.
I have one more question related to the configuration: If I want to use Ruuvi tags together with third party BLE sensors (for example some iBeacons)with Ruuvi Gateway, I could make the json setting as below, couldnāt I?
Probably not, the filtering is done on Bluetooth chip level and that chip has really constrained resources.
We are considering adding an allowlist of tags, that could allow user to configure specific tags per gateway to send.
You need to put the JSON to server which the Gateway can access, any text editor will do for editing. The Gateway will then try to download the configuration.
Hello, Otso. I am on ruuvi gateway firmware 1.24.4. I still have problem with update the configuration via HTTP.
According to this documentation: Gateway configuration - docs (ruuvi.com)
I set up a simple local HTTP server with python http.server at port 8080 and set the correct firewall rules.
I put two json files in the directory with the name: <gw_mac>.json and gw_cfg.json
When I set from GUI - Automatic Configuration Download the url and pressed download. It reported me
Failed to get gw_cfg.json from the remote server. Status: 503 (Service Unavailable)
But both the server and wireshark confirms the succesful http request and reply:
Actually ruuvi gateway did not even request for gw_cfg.json when I had correct <ruuvi_mac>.json at the directory. I tried to remove <ruuvi_mac>.json, ruuvi gateway did request for gw_cfg.json, and there was successful respond, but I got the same 503 error.
Then I tried to send HTTP request (via python and POSTMAN) to read and write the configuration files. But again I had no luck.
I sent HTTP GET/POST to Ruuvi gateway via ā/ruuvi.jsonā api. However, I kept get 401 error. I tried both ābasic authā and ābear tokenā, but none of them worked. ābear tokenā worked on ā/historyā though.
Could you give some help? (BTW, Ruuvi has great documentation for developers, thanks a lot!)
The most likely cause of error 503 when downloading gw_cfg.json from the remote server is that the gw_cfg.json has the wrong format.
Please check the following:
gw_cfg.json must begin with the character ā{ā
gw_cfg.json must be a valid JSON
āuse_remote_cfgā in gw_cfg.json must be ātrueā
When you connect Gateway to a PC via USB, it creates a serial port (COM-port) for logging, so you can connect to this serial port with an application like Putty (or similar), look at the logs, and see the cause of the problem.
@Alexey Thanks you for your reply. My json was valid. However, I only had field
{ācoordinatesā: ā12.34 56.78ā}. Should I have every settings for json? When I added:
{ācoordinatesā: ā12.34 56.78ā, āuse_remote_cfgā: ture}
gateway lost itās static IP configuration. I had to poke the pin and use Wi-Fi to get into the gateway.
Wonderful. Thanks a lot. The work around worked. Great support from Ruuvi as usual.
I am encountering another problem though: āNonceā field from the payload is gone. I am not sure how did it happen. Was it caused by I updated the setting via http with only ācoordinatesā? I resetted the gateway by press 5s reset button/pin. And reconfigured by web-UI. But there is no āNonceā field from the payload. The documentation for the payload schema showed āNonceā was required field. Is it removed from firmware all together or there was a new bug?
Update: it turns out /history api wonāt give Nonce field. But from serial terminal, Nonce field was indeed there in the payload.
PS. I couldnāt find the release notes for each firmware(from ruuviās github), could you point it out?