NEWS
RegEx Probleme
-
Hallo,
ich bin dran den rpi Adapter umzuschreiben auf mein System (Debian VM) auf Synology Nas.
"native": { "c_cpu": true, "c_raspberry": false, "c_memory": true, "c_network": true, "c_sdcard": true, "c_swap": true, "c_temperature": true, "c_uptime": true, "c_wlan": true, "interval": 60000, "cpu": { "cpu_frequency": { "command": "cat /proc/cpuinfo", "regexp": "cpu\\sMHz\\s+:\\s(\\d+).\\d+", "post": "$1" }, "load1,load5,load15": { "command": "cat /proc/loadavg", "regexp": "^(\\S+)\\s(\\S+)\\s(\\S+)", "post": "" }, "scaling_governor": { "command": "cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor", "regexp": "(.*)", "post": "" } }, cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 92 model name : Intel(R) Celeron(R) CPU J3455 @ 1.50GHz stepping : 9 microcode : 0x1 cpu MHz : 1497.610 cache size : 1024 KB physical id : 0 siblings : 2 core id : 0 cpu cores : 2 apicid : 0 initial apicid : 0 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl eagerfpu pni pclmulqdq vmx ssse3 cx16 sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes rdrand hypervisor lahf_lm 3dnowprefetch tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust smep erms mpx rdseed smap clflushopt bugs : bogomips : 2995.22 clflush size : 64 cache_alignment : 64 address sizes : 40 bits physical, 48 bits virtual power management: processor : 1 vendor_id : GenuineIntel cpu family : 6 model : 92 model name : Intel(R) Celeron(R) CPU J3455 @ 1.50GHz stepping : 9 microcode : 0x1 cpu MHz : 1497.610 cache size : 1024 KB physical id : 0 siblings : 2 core id : 1 cpu cores : 2 apicid : 1 initial apicid : 1 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl eagerfpu pni pclmulqdq vmx ssse3 cx16 sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes rdrand hypervisor lahf_lm 3dnowprefetch tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust smep erms mpx rdseed smap clflushopt bugs : bogomips : 2995.22 clflush size : 64 cache_alignment : 64 address sizes : 40 bits physical, 48 bits virtual power management:Im Broker kommt:
rpi2.0 2017-12-15 10:49:48.010 error No Value found for cpu_frequency
Wer hat eine Ahnung warum das nicht funktioniert?
Im Regex Tester funtioniert es.
Viele Grüße
Marcel Jaud
-
Ich habe mal den Code in Code-Tags gesetzt.
Was bitte machst du da?
und wie genau gehst du vor?
Gruß
Rainer
-
Hallo,
Also oben der Code ist vom rpi2 json File.
"cpu_frequency": {
"command": "cat /proc/cpuinfo",
"regexp": "cpu\sMHz\s+:\s(\d+).\d+",
"post": "$1"
}
Da versuche ich die CPU Frequenz aus der cpuinfo auszulesen und per Regex zu bekommen.
Aber ich bekomme ein Fehler in iobroker.
Danke und viele Grüße
Marcel Jaud
Hey! Du scheinst an dieser Unterhaltung interessiert zu sein, hast aber noch kein Konto.
Hast du es satt, bei jedem Besuch durch die gleichen Beiträge zu scrollen? Wenn du dich für ein Konto anmeldest, kommst du immer genau dorthin zurück, wo du zuvor warst, und kannst dich über neue Antworten benachrichtigen lassen (entweder per E-Mail oder Push-Benachrichtigung). Du kannst auch Lesezeichen speichern und Beiträge positiv bewerten, um anderen Community-Mitgliedern deine Wertschätzung zu zeigen.
Mit deinem Input könnte dieser Beitrag noch besser werden 💗
Registrieren Anmelden