How does Pysnmp load third-party mib libraries? - pysnmp

I downloaded the mib library on cisco's official website. The mib files are suffixed with .my, but I don't know how to use pysnmp to reference these mib files.

You should be able to just give pysnmp a path to the location of your MIBs (as well as the base MIBs they import), pysnmp should be able to consume these .my files:
from pysnmp.hlapi import *
errorIndication, errorStatus, errorIndex, varBinds = next(
getCmd(SnmpEngine(),
CommunityData('public'),
UdpTransportTarget(('demo.snmplabs.com', 161)),
ContextData(),
ObjectType(
ObjectIdentity(
'IF-MIB', 'ifInOctets', 1).addAsn1MibSource(
'file:///home/user/mibs/', 'http://mibs.snmplabs.com/asn1/#mib#')))
)

Related

How to fix this error for installing AutoGluon on Linux

I am trying to install AutoGluon on my university computer (Linux)
I followed the instruction given here https://auto.gluon.ai/stable/index.html
pip3 install -U pip
pip3 install -U setuptools wheel
# CPU version of pytorch has smaller footprint - see installation instructions in
# pytorch documentation - https://pytorch.org/get-started/locally/
pip3 install torch==1.12+cpu torchvision==0.13.0+cpu torchtext==0.13.0 -f https://download.pytorch.org/whl/cpu/torch_stable.html
pip3 install autogluon
all steps ended successfully except for the last one pip3 install autogluon
I am getting this error
user99#tinaroo1:~/autogluon> pip3 install autogluon
Keyring is skipped due to an exception: 'EntryPoints' object has no attribute 'get'
Defaulting to user installation because normal site-packages is not writeable
Collecting autogluon
Using cached autogluon-0.6.0-py3-none-any.whl (9.8 kB)
Collecting autogluon.multimodal==0.6.0
Using cached autogluon.multimodal-0.6.0-py3-none-any.whl (279 kB)
Collecting autogluon.timeseries[all]==0.6.0
Using cached autogluon.timeseries-0.6.0-py3-none-any.whl (101 kB)
Collecting autogluon.features==0.6.0
Using cached autogluon.features-0.6.0-py3-none-any.whl (59 kB)
Collecting autogluon.core[all]==0.6.0
Using cached autogluon.core-0.6.0-py3-none-any.whl (224 kB)
Collecting autogluon.vision==0.6.0
Using cached autogluon.vision-0.6.0-py3-none-any.whl (49 kB)
Collecting autogluon.tabular[all]==0.6.0
Using cached autogluon.tabular-0.6.0-py3-none-any.whl (285 kB)
Collecting autogluon.text==0.6.0
Using cached autogluon.text-0.6.0-py3-none-any.whl (62 kB)
Requirement already satisfied: numpy<1.24,>=1.21 in /home/user99/.local/lib/python3.7/site-packages (from autogluon.core[all]==0.6.0->autogluon) (1.21.5)
Requirement already satisfied: scipy<1.10.0,>=1.5.4 in /home/user99/.local/lib/python3.7/site-packages (from autogluon.core[all]==0.6.0->autogluon) (1.7.1)
Collecting autogluon.common==0.6.0
Using cached autogluon.common-0.6.0-py3-none-any.whl (41 kB)
Requirement already satisfied: matplotlib in /mnt/sw/legacy/sw1/RCC/Anaconda/2020.02/lib/python3.7/site-packages (from autogluon.core[all]==0.6.0->autogluon) (3.2.2)
Requirement already satisfied: tqdm>=4.38.0 in /mnt/sw/legacy/sw1/RCC/Anaconda/2020.02/lib/python3.7/site-packages (from autogluon.core[all]==0.6.0->autogluon) (4.47.0)
Requirement already satisfied: requests in /mnt/sw/legacy/sw1/RCC/Anaconda/2020.02/lib/python3.7/site-packages (from autogluon.core[all]==0.6.0->autogluon) (2.24.0)
Requirement already satisfied: scikit-learn<1.2,>=1.0.0 in /home/user99/.local/lib/python3.7/site-packages (from autogluon.core[all]==0.6.0->autogluon) (1.0.2)
Requirement already satisfied: pandas!=1.4.0,<1.6,>=1.2.5 in /home/user99/.local/lib/python3.7/site-packages (from autogluon.core[all]==0.6.0->autogluon) (1.3.5)
Requirement already satisfied: boto3 in /home/user99/.local/lib/python3.7/site-packages (from autogluon.core[all]==0.6.0->autogluon) (1.26.23)
Requirement already satisfied: dask<=2021.11.2,>=2021.09.1 in /home/user99/.local/lib/python3.7/site-packages (from autogluon.core[all]==0.6.0->autogluon) (2021.11.2)
Requirement already satisfied: distributed<=2021.11.2,>=2021.09.1 in /home/user99/.local/lib/python3.7/site-packages (from autogluon.core[all]==0.6.0->autogluon) (2021.11.2)
Requirement already satisfied: ray<2.1,>=2.0 in /home/user99/.local/lib/python3.7/site-packages (from autogluon.core[all]==0.6.0->autogluon) (2.0.1)
Requirement already satisfied: hyperopt<0.2.8,>=0.2.7 in /home/user99/.local/lib/python3.7/site-packages (from autogluon.core[all]==0.6.0->autogluon) (0.2.7)
Requirement already satisfied: psutil<6,>=5.7.3 in /home/user99/.local/lib/python3.7/site-packages (from autogluon.features==0.6.0->autogluon) (5.9.4)
Collecting seqeval<=1.2.2
Using cached seqeval-1.2.2.tar.gz (43 kB)
Preparing metadata (setup.py) ... done
Collecting omegaconf<2.2.0,>=2.1.1
Using cached omegaconf-2.1.2-py3-none-any.whl (74 kB)
Collecting scikit-image<0.20.0,>=0.19.1
Using cached scikit_image-0.19.3-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (13.5 MB)
Collecting sentencepiece<0.2.0,>=0.1.95
Using cached sentencepiece-0.1.97-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB)
Collecting torchmetrics<0.9.0,>=0.8.0
Using cached torchmetrics-0.8.2-py3-none-any.whl (409 kB)
Requirement already satisfied: torchvision<0.14.0 in /home/user99/.local/lib/python3.7/site-packages (from autogluon.multimodal==0.6.0->autogluon) (0.13.0+cpu)
Collecting accelerate<0.14,>=0.9
Using cached accelerate-0.13.2-py3-none-any.whl (148 kB)
Collecting evaluate<=0.2.2
Using cached evaluate-0.2.2-py3-none-any.whl (69 kB)
Collecting nptyping<1.5.0,>=1.4.4
Using cached nptyping-1.4.4-py3-none-any.whl (31 kB)
Collecting defusedxml<=0.7.1,>=0.7.1
Using cached defusedxml-0.7.1-py2.py3-none-any.whl (25 kB)
Collecting openmim<=0.2.1,>0.1.5
Using cached openmim-0.2.1-py2.py3-none-any.whl (49 kB)
Requirement already satisfied: torchtext<0.14.0 in /home/user99/.local/lib/python3.7/site-packages (from autogluon.multimodal==0.6.0->autogluon) (0.13.0)
Collecting albumentations<=1.2.0,>=1.1.0
Using cached albumentations-1.2.0-py3-none-any.whl (113 kB)
Collecting pycocotools<2.0.7,>=2.0.5
Using cached pycocotools-2.0.6.tar.gz (24 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: -11
╰─> [35 lines of output]
OpenBLAS blas_thread_init: pthread_create: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC 50 current, 514567 max
OpenBLAS blas_thread_init: pthread_create: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC 50 current, 514567 max
OpenBLAS blas_thread_init: pthread_create: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC 50 current, 514567 max
OpenBLAS blas_thread_init: pthread_create: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC 50 current, 514567 max
OpenBLAS blas_thread_init: pthread_create: Resource temporarily unavailable
OpenBLAS blas_thread_init: RLIMIT_NPROC 50 current, 514567 max
Traceback (most recent call last):
File "/home/user99/.local/lib/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 351, in <module>
main()
File "/home/user99/.local/lib/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 333, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/home/user99/.local/lib/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
File "/scratch/user/user99/tmp/pip-build-env-j7xhslnv/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 338, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
File "/scratch/user/user99/tmp/pip-build-env-j7xhslnv/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 320, in _get_build_requires
self.run_setup()
File "/scratch/user/user99/tmp/pip-build-env-j7xhslnv/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 335, in run_setup
exec(code, locals())
File "<string>", line 7, in <module>
File "/scratch/user/user99/tmp/pip-build-env-j7xhslnv/overlay/lib/python3.7/site-packages/numpy/__init__.py", line 142, in <module>
from . import add_newdocs
File "/scratch/user/user99/tmp/pip-build-env-j7xhslnv/overlay/lib/python3.7/site-packages/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/scratch/user/user99/tmp/pip-build-env-j7xhslnv/overlay/lib/python3.7/site-packages/numpy/lib/__init__.py", line 8, in <module>
from .type_check import *
File "/scratch/user/user99/tmp/pip-build-env-j7xhslnv/overlay/lib/python3.7/site-packages/numpy/lib/type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "/scratch/user/user99/tmp/pip-build-env-j7xhslnv/overlay/lib/python3.7/site-packages/numpy/core/__init__.py", line 16, in <module>
from . import multiarray
KeyboardInterrupt
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: -11
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
user99#tinaroo1:~/autogluon>
I wonder if it makes sense to anyone and can help me fixing that.

PlatformIO:[upload] Error 2 with esp8266 ESP-07 board

I use VSCODE to create project. I create a project and select ESp-07 board and ESP8266 RTOS SDK framework then create a main.c file in src directory and copy content of main.c file of esp8266-rtos-sdk-blink example to my project main.c file. it compile successfully but when i want to upload it to my board following error occur :
Processing esp07 (platform: espressif8266; framework: esp8266-rtos-sdk; board: esp07)
Verbose mode can be enabled via -v, --verbose option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/esp07.html
PLATFORM: Espressif 8266 2.3.2 > Espressif Generic ESP8266 ESP-07
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES: toolchain-xtensa 1.40802.0 (4.8.2), framework-esp8266-rtos-sdk 1.5.0-beta.5, tool-esptool
1.413.0 (4.13), tool-esptoolpy 1.20800.0 (2.8.0), tool-mkspiffs 1.200.0 (2.0)
LDF: Library Dependency Finder -> bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies…
No dependencies
Building in release mode
Retrieving maximum program size .pio\build\esp07\firmware.elf
Checking size .pio\build\esp07\firmware.elf
Advanced Memory Usage is available via “PlatformIO Home > Project Inspect”
DATA: [==== ] 36.3% (used 29754 bytes from 81920 bytes)
PROGRAM: [======= ] 73.9% (used 278664 bytes from 376832 bytes)
Configuring upload protocol…
AVAILABLE: espota, esptool
CURRENT: upload_protocol = esptool
Looking for upload port…
Auto-detected: COM3
Uploading .pio\build\esp07\firmware.bin
esptool.py v2.8
Serial port COM3
Connecting…
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: 5c:cf:7f:33:a6:e6
Uploading stub…
Running stub…
Stub running…
Configuring flash size…
Auto-detected Flash size: 1MB
A fatal error occurred: File C:\Users\MrTavakoli.platformio\packages\framework-esp8266-rtos-sdk\bin\esp_init_data_default.bin (length 128) at offset 4177920 will not fit in 1048576 bytes of flash. Use --flash-size argument, or change flashing address.
*** [upload] Error 2
I test my board with Arduino framework successfully.
Thanks you
I use esp01-1M board instead of esp07 board and compile then upload to esp07 board successfully.
again change board to esp07 and add
board_upload.maximum_size = 1048576
to platformio.ini file and compile and upload toesp07` board successfully.
I found 1048576 value from esp01_1m.json file.

Trouble building u-boot for gumstix overo on yocto "thud" release

Attempting to build a yocto image using the "thud" release, bitbake fails on building the version of u-boot that comes with the meta-gumstix thud branch, which is 2016.03 (which seems antique?).
The error I'm seeing is regarding conflicting types, e.g.
ERROR: u-boot-v2016.03+gitAUTOINC+df61a74e68-r0 do_compile: oe_runmake failed
…
/home/kwisatz/yocto-new/build/tmp/work/overo-poky-linux-gnueabi/u-boot/v2016.03+gitAUTOINC+df61a74e68-r0/recipe-sysroot-native/usr/include/libfdt_env.h:71:30: error: conflicting types for 'fdt64_t'
typedef uint64_t FDT_BITWISE fdt64_t;
Searching the Internet for that, one quickly comes across a range of threads explaining that the problem is the libfdt-dev.h header that comes with the dtc package. Some recommend to blacklist or uninstall the dtc package, but from what I see, it's explicitly required by the u-boot recipe in the gumstix layer for yocto:
DEPENDS += "dtc-native"
See also https://patchwork.openembedded.org/patch/147816/
However, in the thread linked to above, we're talking versions 2018.01 and 2018.03, not 2016.03
The poky layer for thud brings u-boot 2018.07 which builds fine, but with that one, my overo (Airstorm-Y) won't boot anymore:
Booting from nand with DTS...
UBI: attaching mtd1 to ubi0
UBI: scanning is finished
UBI: attached mtd1 (name "mtd=4", size 1013 MiB) to ubi0
UBI: PEB size: 131072 bytes (128 KiB), LEB size: 129024 bytes
UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 512
UBI: VID header offset: 512 (aligned 512), data offset: 2048
UBI: good PEBs: 8108, bad PEBs: 0, corrupted PEBs: 0
UBI: user volume: 1, internal volumes: 1, max. volumes count: 128
UBI: max/mean erase counter: 1/0, WL threshold: 4096, image sequence number: 1485359018
UBI: available PEBs: 0, total reserved PEBs: 8108, PEBs reserved for bad PEB handling: 160
** File not found /boot/omap3-overo-storm-tobi.dtb **
Loading file '/boot/zImage' to addr 0x82000000 with size 5097744 (0x004dc910)...
Done
Kernel image # 0x82000000 [ 0x000000 - 0x4dc910 ]
ERROR: Did not find a cmdline Flattened Device Tree
Could not find a valid device tree
I'm not entirely sure if this boot problem is related to the u-boot build or to the kernel image that I've built (see my previous thread)?
Any tips on how I could solve this issue? Is there a more recent version of u-boot in a gumstix layer for yocto that I haven't discovered just yet, or do you have any other tips on how I could get a working yocto image for my overo?
P.S. Note that during the build, I'm also seeing these warning, but I don't think there's an actual problem here:
WARNING: u-boot-v2016.03+gitAUTOINC+df61a74e68-r0 do_patch:
Some of the context lines in patches were ignored. This can lead to incorrectly applied patches.
The context lines in the patches can be updated with devtool:
devtool modify <recipe>
devtool finish --force-patch-refresh <recipe> <layer_path>
Then the updated patches and the source tree (in devtool's workspace)
should be reviewed to make sure the patches apply in the correct place
and don't introduce duplicate lines (which can, and does happen
when some of the context is ignored). Further information:
http://lists.openembedded.org/pipermail/openembedded-core/2018-March/148675.html
https://bugzilla.yoctoproject.org/show_bug.cgi?id=10450
Details:
Applying patch 0006-duovero-Read-eeprom-over-i2c.patch
patching file board/gumstix/duovero/duovero.c
patching file include/configs/duovero.h
Hunk #2 succeeded at 50 with fuzz 2 (offset -4 lines).
Now at patch 0006-duovero-Read-eeprom-over-i2c.patch
[…]
If you're looking for a new (development, not stable) image for the Overo I would recommend the Warrior branch
https://github.com/gumstix/yocto-manifest/tree/warrior
It has been tested and confirmed working for the Overo. The Thud branch was added to our repo to add support for the Raspberry Pi CM3+. For an older (stable) image, I would recommend Morty
https://github.com/gumstix/yocto-manifest/tree/morty
Thanks.
At least for me, with the same issue, i just removed
DEPENDS += "dtc-native"
and build completed.

Anyone booted ecos with u-boot?

I need to port ecos on new platform board with u-boot.
Everywhere I am able to find Porting guide for ecos with redboot.
Did anyone booted ecos with u-boot?
I got some link which tells it's possible to boot ecos with u-boot?
https://sourceware.org/ml/ecos-discuss/2010-06/msg00038.html
But I am not able to find any document regarding that.
I tried following following procedure to boot ecos with u-boot
compiled ecos 3.0
ecosconfig new
ecosconfig tree
make
cross compiled and generated sample hello_world elf linking library
generated in previous make.
Powered on the board and stopped at u-boot(prebuilt u-boot already in
flash)
Transferred hello_world to a load_addr(entry point address of RAM) through tftp
bootelf load_addr
But it got hanged as follows,
bootelf 0x820000bc
Loading .rom_vectors # 0x82000000 (204 bytes)
Loading .text # 0x820000cc (224132 bytes)
EDIT :
When I try loading at address 0x81000000 It proceed further as follows,
bootelf 0x81000000
Loading .rom_vectors # 0x82000000 (204 bytes)
Loading .text # 0x820000cc (207960 bytes)
Loading .rodata # 0x82032d28 (7296 bytes)
Loading .data # 0x820349a8 (2544 bytes)
Loading .ctors # 0x82035398 (80 bytes)
Loading .dtors # 0x820353e8 (56 bytes)
Loading .devtab # 0x82035420 (608 bytes)
Clearing .sbss # 0x82035680 (276 bytes)
Clearing .bss # 0x82035798 (313052 bytes)
## Starting application at 0x820000bc ...
But hangs after the above line. My ELF file size is around 1.9 MB. Will it make a problem?
Note: RAM size - 8 MB (0x80000000 - 0x88000000)
It shouldn't be hard. If you have an ELF file, bootelf will boot it.

Differences between pyserial 2.3 and 2.7?

can someone list the differences between pyserial 2.6 and pyserial 2.7
I'm unable to get the release notes for both the releases.
The list is maintained in CHANGES.rst on GitHub.
Version 2.7 2013-10-17
Win32: setRTS and setDTR can be called before the port is opened and it will set the initial state on port open.
Posix: add platform specific method: outWaiting (already present for Win32)
Posix: rename flowControl to setXON to match name on Win32, add flowControlOut function
rfc2217: zero polls value (baudrate, data size, stop bits, parity) (Erik Lundh)
Posix: [Patch pyserial:28] Accept any speed on Linux [update]
Posix: [Patch pyserial:29] PosixSerial.read() should "ignore" errno.EINTR
OSX: [Patch pyserial:27] Scan by VendorID/Product ID for USB Serial devices
Ensure working with bytes in write() calls
Bugfixes:
[Bug 3540332] SerialException not returned
[Bug pyserial:145] Error in socket_connection.py
[Bug pyserial:135] reading from socket with timeout=None causes TypeError
[Bug pyserial:130] setup.py should not append py3k to package name
[Bug pyserial:117] no error on lost conn w/socket://
Bugfixes (posix):
[Patch 3462364] Fix: NameError: global name 'base' is not defined
list_ports and device() for BSD updated (Anders Langworthy)
[Bug 3518380] python3.2 -m serial.tools.list_ports error
[Bug pyserial:137] Patch to add non-standard baudrates to Cygwin
[Bug pyserial:141] open: Pass errno from IOError to SerialException
[Bug pyserial:125] Undefined 'base' on list_ports_posix.py, function usb_lsusb
[Bug pyserial:151] Serial.write() without a timeout uses 100% CPU on POSIX
[Patch pyserial:30] [PATCH 1/1] serial.Serial() should not raise IOError.
Bugfixes (win32):
[Bug 3444941] ctypes.WinError() unicode error
[Bug 3550043] on Windows in tools global name 'GetLastError' is not defined
[Bug pyserial:146] flush() does nothing in windows (despite docs)
[Bug pyserial:144] com0com ports ignored due to missing "friendly name"
[Bug pyserial:152] Cannot configure port, some setting was wrong. Can leave port handle open but port not accessible