This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

SNMP protocol in Logic Machine
#61
admin,

as always all working super!! Big thanks for advices and help!

Alex
Reply
#62
Hi,
As we can now receive bytes in and out 0ver SNMP, how correctly calculate bit/per second from received data?

I found very easy calculation method:
We can calculate the throughput of an interface using this technique:

take a sample of the total bytes-in, wait 60 seconds and take another sample bytes-in total.

TotalByteIn [t = 0s] is total bytes-in after 0 seconds
TotalByteIn [t = 60s] is total bytes-in after 60 second

The average throughput in this time interval is calculated using this formula (the value is Bps)

(TotalByteIn [t = 60s] - TotalByteIn [t = 0s]) / 60 = Throughput

So 60 here - time in seconds, delay between request of SNMP information. Question - how easier store previous data to calculate BPS (I need received value - last one or previous, or other variant - now and next value after 60 seconds).

I tried resident script with time 0, not working but strange - in log showing TX1 and TX2 the same values, but BPS different (in my case I receiving SNMP data every 10 seconds)..

TX1 = grp.getvalue('38/5/22')
log('TX1', TX1)
os.sleep(10)
TX2 = grp.getvalue('38/5/22')
log('TX2', TX2)
BPS = (TX2-TX1)/10

log('BPS', BPS)

How better calculate BPS??

BR,
Alex
Reply
#63
Use storage to store previous object value.
See these examples:
https://forum.logicmachine.net/showthrea...6#pid16316
https://forum.logicmachine.net/showthrea...07#pid1707
Reply
#64
(04.09.2018, 09:17)AEK Wrote: Hi, as I know, traps are still not supported
You need packages  luasnmp and libnetsnmp
you can download it for imx28 here https://dl.openrb.com/lm-17/pkg
for imx6 here https://dl.openrb.com/lm-17-imx6/pkg/

Hi, I have installed these pakkages, but when running the script it says:

Resident script:1: module 'snmp' not found:
no field package.preload['snmp']
no file './snmp'
no file 'Library snmp'
no file 'Library snmp'
no file 'Library snmp.so'
stack traceback:
[C]: in function 'require


What am I missing?
Reply
#65
Which firmware are you using? Have you tried the latest packages (https://dl.openrb.com/lm-20-imx6/pkg/)?
Reply
#66
(09.12.2020, 07:07)admin Wrote: Which firmware are you using? Have you tried the latest packages (https://dl.openrb.com/lm-20-imx6/pkg/)?
These versions runs error on install.

Running:
HW: Wiser for KNX (i.MX6)
SW: 2.5.1
Reply
#67
(09.12.2020, 07:07)admin Wrote: Which firmware are you using? Have you tried the latest packages (https://dl.openrb.com/lm-20-imx6/pkg/)?

hello admin 
I have LM Lite + Ext
SW 20200727

when I try to upload the packages I got :

Attached Files Thumbnail(s)
       
Best Regards,
Reply
#68
You have to install these packages through System config > System > Packages > Add (+) button
Reply
#69
(11.03.2021, 13:15)admin Wrote: You have to install these packages through System config > System > Packages > Add (+) button

hello admin thank you for your response
I upload the packages 
I use the walk through SNMP code but I get the following error:

User script:40: attempt to index global 'snmp' (a nil value)
stack traceback:
User script:40: in main chunk


Best Regards,
Reply
#70
Add require('snmp') at the beginning of your script.
Reply
#71
(11.03.2021, 13:34)admin Wrote: Add require('snmp') at the beginning of your script.

Thank you admin for your response 
I got a time out in the log what should I check

* arg: 1
  * nil
* arg: 2
  * string: walk failed: snmp: timeout
Best Regards,
Reply
#72
This means that LM cannot reach the SNMP device on the network. Check that IP address is correct.
Reply
#73
Good day!

Tell me, is it possible to transfer data from the KNX to the SNMP by means of LM so that another client can monitor the data?
Reply
#74
See this
https://forum.logicmachine.net/showthrea...5#pid14905
------------------------------
Ctrl+F5
Reply
#75
Hello 
I added the libnetsnmp and luasnmp packages Please see attached image.

I used the old HL ,V2.7.0
but When I run my script I got the following errors:

Resident script:3: module 'snmp' not found:
no field package.preload['snmp']
no file './snmp'
no file 'Library snmp'
no file 'Library snmp'
no file 'Library snmp.so'
stack traceback:
[C]: in function 'require'

Attached Files Thumbnail(s)
   
Best Regards,
Reply
#76
Go to System Config - System - Packages and press + to install.
------------------------------
Ctrl+F5
Reply
#77
(19.09.2022, 07:33)Daniel Wrote: Go to System Config - System - Packages and press + to install.

Hello Daniel
I have the old Schneider electric HomeLynk but I am using FM-V 2.7.0.
I cant find any packages installation option!

Attached Files Thumbnail(s)
   
Best Regards,
Reply
#78
SE does not have this option. Next time buy LM Smile
In upcoming fw snmp libraries will be added. Just wait for a while.
------------------------------
Ctrl+F5
Reply
#79
(19.09.2022, 10:59)Daniel Wrote: SE does not have this option. Next time buy LM Smile
In upcoming fw snmp libraries will be added. Just wait for a while.

Great.
For Both SE and LM?
Best Regards,
Reply
#80
Yes, for both.
Reply


Forum Jump: