Comments (20)
@dukess: Since you have been working on the JSON output for a while (and I'm not sure if I would break anything), I was wondering what you think about this? Maybe we could add a new /Jx command for outputting (some of) the configuration, including the MAC address?
from bsb-lan.
This is real problem. So I'll leave this idea and try to make a /JI command.
from bsb-lan.
Ready for merging: #92
{
"version": "0.44.11-20200410111601",
"freeram": 3049,
"uptime": 115800,
"MAC": "00:80:41:19:69:90",
"bus": "BSB",
"buswritable": 1,
"busaddr": 66,
"busdest": 0,
"monitor": 0,
"verbose": 1,
"protectedGPIO": [
{ "pin": 10 },
{ "pin": 11 },
{ "pin": 12 },
{ "pin": 13 },
{ "pin": 50 },
{ "pin": 51 },
{ "pin": 52 },
{ "pin": 53 },
{ "pin": 62 },
{ "pin": 63 },
{ "pin": 64 },
{ "pin": 65 },
{ "pin": 66 },
{ "pin": 67 },
{ "pin": 68 },
{ "pin": 69 }
],
"averages": [
{ "parameter": 8700 },
{ "parameter": 8326 }
],
"loginterval": 3600,
"logged": [
{ "parameter": 8700 },
{ "parameter": 8314 },
{ "parameter": 8830 }
]
}
from bsb-lan.
The firmware version would be possible to add to the JSON export as some kind of virtual parameter for example, but the MAC address is a problem. It is set by the software and so far all BSB-LAN installations have the same MAC address ;). This was because so far it was not possible to read the MAC address from the Ethernet Shield (at least version 1, haven't tried with version 2 because I don't have one).
Also a random generated number would have to be stored in EEPROM, checked if it exists, and if yes, not be generated again. And this part of the EEPROM would have to be protected from a "clean EEPROM" call. Then again, if you want to reset everything, this EEPROM part would also have to be reset.
But maybe it does not hurt that the MAC address is always the same as long as you change it manually (which you can) when you have more than one device running?
from bsb-lan.
I think this will do just fine. It's that i need an identifier for the bsblan device. And indeed if you have multiple you can change it.
thanks
from bsb-lan.
Ok, so I'll send the Mac address via JSON.
from bsb-lan.
Now I use the model nr. of the heating system, but it's not the correct way to do it. You could have multiple heating systems and than this setup wouldn't work anymore.
Can we get serial number from heater/cooler with address 0 immediatly after start and set MAC with this value?
Parameter 6236 return 4 bytes of serial number, so we can add two prefix (00:00 or something else) bytes and use it as MAC.
Maybe we could add a new /Jx command for outputting (some of) the configuration, including the MAC address?
/JI (JSON Information) key will be good idea.
I think we can send all info like /C function.
from bsb-lan.
Can we get serial number from heater/cooler with address 0 immediately after start and set MAC with this value?
I am not sure what you mean? So Serial Heater``0``mac address
?
This shouldn't be needed. Home assistant makes a map/network. So if we can identify the bsblan board it shouldn't be an issue that we have 2 the same serial numbers for the 2 heaters. if they are connected 2 different bsblan boards.
from bsb-lan.
/JI (JSON Information) key will be good idea.
I think we can send all info like /C function.
sounds great!
from bsb-lan.
I think what @dukess means is not to set the MAC address from the _config.h file but read the serial number of the heater and generate a MAC address from that.
However, this would mean that the query of the heating system would have to happen before the network is being set up. And more importantly, it would not work on PPS heating systems which do not have this kind of parameter (and I think those who use an OCI420 on an LMU64 as well).
from bsb-lan.
However, this would mean that the query of the heating system would have to happen before the network is being set up.
I hope that's not a problem.
And more importantly, it would not work on PPS heating systems which do not have this kind of parameter (and I think those who use an OCI420 on an LMU64 as well).
For these cases we can use pre-defined MAC from _config.h.
from bsb-lan.
Well, it's at least inconvenient for those (like me ;) ) who have diverted the output from serial to telnet and thus can remotely get the "serial" output. For debugging, the intial sequence is often important.
from bsb-lan.
👍
from bsb-lan.
I wrote this function, but I can only test it tomorrow or the day after.
https://github.com/dukess/bsb_lan/commits/master/BSB_lan.ino
from bsb-lan.
Wow, that went fast, great, thanks a lot!
from bsb-lan.
Works all in all, I think, but Firefox' JSON parsers gives me the error
SyntaxError: JSON.parse: unexpected character at line 37 column 3 of the JSON data
for this output:
{
"version": "1.0.3-20200522224028",
"freeram": 0,
"uptime": 9531,
"MAC": "00:80:41:19:69:90",
"bus": "BSB",
"buswritable": 1,
"busaddr": 66,
"busdest": 0,
"monitor": 0,
"verbose": 1,
"protectedGPIO": [
{ "pin": 10 },
{ "pin": 11 },
{ "pin": 12 },
{ "pin": 13 },
{ "pin": 50 },
{ "pin": 51 },
{ "pin": 52 },
{ "pin": 53 },
{ "pin": 62 },
{ "pin": 63 },
{ "pin": 64 },
{ "pin": 65 },
{ "pin": 66 },
{ "pin": 67 },
{ "pin": 68 },
{ "pin": 69 }
],
"averages": [
{ "parameter": 8700 },
{ "parameter": 8323 },
{ "parameter": 8326 }
],
"loginterval": 3600,
"logged":
]
}
Line 37 would be the second last line (the closing square bracket). It looks as if this closing bracket is without a corresponding opening bracket?
from bsb-lan.
Works all in all, I think, but Firefox' JSON parsers gives me the error
SyntaxError: JSON.parse: unexpected character at line 37 column 3 of the JSON data
for this output:
{ "version": "1.0.3-20200522224028", "freeram": 0, "uptime": 9531, "MAC": "00:80:41:19:69:90", "bus": "BSB", "buswritable": 1, "busaddr": 66, "busdest": 0, "monitor": 0, "verbose": 1, "protectedGPIO": [ { "pin": 10 }, { "pin": 11 }, { "pin": 12 }, { "pin": 13 }, { "pin": 50 }, { "pin": 51 }, { "pin": 52 }, { "pin": 53 }, { "pin": 62 }, { "pin": 63 }, { "pin": 64 }, { "pin": 65 }, { "pin": 66 }, { "pin": 67 }, { "pin": 68 }, { "pin": 69 } ], "averages": [ { "parameter": 8700 }, { "parameter": 8323 }, { "parameter": 8326 } ], "loginterval": 3600, "logged": ] }
Line 37 would be the second last line (the closing square bracket). It looks as if this closing bracket is without a corresponding opening bracket?
Seems that it shout be opened by logged. But you have no log parameters set.
from bsb-lan.
Exactly.
from bsb-lan.
Ok. Empty list will be not shown.
from bsb-lan.
MAC address is now shown in /JI so I'll close this one here...
from bsb-lan.
Related Issues (20)
- [FEATURE REQUEST] Sending more than 40 register values to MQTT ? HOT 1
- [BUG] compile error HOT 4
- [FEATURE REQUEST] Provide older Version for Arduino Mega 2560 boards HOT 1
- [QUESTION] Publish MQTT into BSB_LAN_custom_setup.h file HOT 1
- [BUG] "/JS" POST request unexpected behavior HOT 8
- [BUG] Web Server Stopped Working HOT 4
- [FEATURE] Heating-Engineer Additional Parameters Access HOT 3
- [BUG] Constat reconnection to mqtt broker HOT 3
- [FEATURE REQUEST] Send BSB-LAN version to MQTT HOT 2
- [BUG] PPS Errors with BSB-LAN Versions > 2.0.16 HOT 116
- [FEATURE REQUEST] No wifi if started after wifi access point HOT 1
- [FEATURE REQUEST] Set date and time HOT 1
- [BUG] Set date and time reset after a while HOT 43
- [BUG] MQTT connection fails HOT 27
- [FEATURE REQUEST] Add support for WT32-ETH1 board HOT 4
- [BUG] SD card vs. flash memory HOT 5
- [BUG] Device hangs for some seconds on socket error with MQTT HOT 2
- [BUG] Heater function list disappeared in version 3.4.3 HOT 9
- [BUG] Set button is not working on parameter that require /I in the we interface HOT 4
- [BUG] BSB-LAN does not compile HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bsb-lan.