Giter Site home page Giter Site logo

Comments (20)

fredlcore avatar fredlcore commented on May 18, 2024 1

@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.

dukess avatar dukess commented on May 18, 2024 1

This is real problem. So I'll leave this idea and try to make a /JI command.

from bsb-lan.

dukess avatar dukess commented on May 18, 2024 1

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.

fredlcore avatar fredlcore commented on May 18, 2024

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.

liudger avatar liudger commented on May 18, 2024

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.

fredlcore avatar fredlcore commented on May 18, 2024

Ok, so I'll send the Mac address via JSON.

from bsb-lan.

dukess avatar dukess commented on May 18, 2024

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.

liudger avatar liudger commented on May 18, 2024

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.

liudger avatar liudger commented on May 18, 2024

/JI (JSON Information) key will be good idea.
I think we can send all info like /C function.

sounds great!

from bsb-lan.

fredlcore avatar fredlcore commented on May 18, 2024

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.

dukess avatar dukess commented on May 18, 2024

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.

fredlcore avatar fredlcore commented on May 18, 2024

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.

fredlcore avatar fredlcore commented on May 18, 2024

👍

from bsb-lan.

dukess avatar dukess commented on May 18, 2024

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.

fredlcore avatar fredlcore commented on May 18, 2024

Wow, that went fast, great, thanks a lot!

from bsb-lan.

fredlcore avatar fredlcore commented on May 18, 2024

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.

BudBundi avatar BudBundi commented on May 18, 2024

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.

fredlcore avatar fredlcore commented on May 18, 2024

Exactly.

from bsb-lan.

dukess avatar dukess commented on May 18, 2024

Ok. Empty list will be not shown.

from bsb-lan.

fredlcore avatar fredlcore commented on May 18, 2024

MAC address is now shown in /JI so I'll close this one here...

from bsb-lan.

Related Issues (20)

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.