When that is included I get compilation errors (below). Change to an ESP32 board and it works fine. It’s not exactly a syntax error, it appears that the bk72xx board type is doing something to change the c library search path.
Am I missing something? Bug in that (whatever you call bk72xx)?
I’m including a sample file that shows this with esphome 2025.2.2.
I’m baffled where to go with this – not sure if the git project is not constructed correctly, or bk72xx is bad, or I’m doing something else wrongly.
The error is that the include of SNMP_Agent.h is not being found. The double quote should search the current file’s folder, which seemingly is where the project’s include would put it.
If the build was failing due to (for example) a lack of a wifi API being included it would make sense. But it’s the actual header for the C module, that should come in at the same time that appears to not be present.
I’m not trying to make the case that if it would compile it would work, or even that it will link and find all the needed pieces, but… why is it that it can’t find the header it just included?
because the MCU platform it is using doesn’t have it. The project you are using has a long list of dependencies. The platform (specific tuya devices) does support at least one of them. The project you are using (from GitHub) doesn’t indicate what it works with, but looking at the code it appears to support both eps8266 and esp32. You are not using either of those, and it doesn’t work. The platform you are using appears to have no SNMP support at all. It might be possible to port the SNMP code from a different platform over to this one, but it seems no one has done that already.
Maybe I’m just dense. Thanks for trying to explain.
But please realize this project IS the snmp support. There’s no built in SNMP support in either esp32 or esp8266 as far as I can find, the project does all the implementation for a limited agent, dependent primarily on the wifi networking existing.
Anyway, I guess the main point is it doesn’t work, so I need to not try to use it.
And, here is the code that shows it will not work for you:
if CORE.is_esp8266 or CORE.is_esp32:
cg.add_library(r"https://github.com/aquaticus/Arduino_SNMP.git", "2.1.0")
To be clear, the repo code could do a better job of being clear that it ONLY works with esp chips AND provide a clear message when you try and use it with something else.
One of the reasons there has been a push to external components is that they provide a mechanism for making it clear they won’t work when something is not quite right. But, the documentation on creating external components is not complete enough for most people to follow. There are quite a few places where it essentially says, “it’s a mystery, go read the code to figure it out”. That is a very steep learning curve, more like a high brick wall you have to scale.
I am sorry. You are absolutely correct (but you knew that didn’t you ).
For reasons lost on me I kept reading that SNMP_Agent.h was not found and that the project was providing SNMP_Agent.h. But the project provides snmp_component.h, not SNMP_Agent.h.
Sigh.
I wish I could claim not to be able to read C, but the problem is my memory doesn’t last the time it takes to go from one screen to the other.
Thank you for banging me beside the head hard enough it would finally sink in.
The author could have done a little better job of mentioning it relied on other SNMP code. But the fault is my failure to pay attention.
Thanks. I’m thinking I may just remove it. There’s not a whole lot there I can’t do with either just ping checks, or tests in Home Assistant. I trust Zabbix more than home assistant (in terms of always up and reporting).
But yes, I can chase it there, and probably other places I’ll run into if I worked through every device. Thanks for the pointer though to where to look.