Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"TypeError: ord() expected string of length 1, but int found" in network.py #169

Open
InFerYes opened this issue Jul 24, 2022 · 0 comments

Comments

@InFerYes
Copy link

Hi, I'm having an issue getting semonitor.py to run.

I'm running semonitor.py on Arch Linux with the latest updates:

Linux stripe 5.18.7-1-danctnix #1 SMP PREEMPT_DYNAMIC Mon Jul 11 04:43:57 UTC 2022 aarch64 GNU/Linux

I have given the host a fixed ip and there are no services using port 53:

6: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:e0:4c:36:02:b7 brd ff:ff:ff:ff:ff:ff
    inet 192.168.100.1/24 brd 192.168.100.255 scope global noprefixroute eth0
       valid_lft forever preferred_lft forever

Running Python 3.10.5.

I run the script with sudo python semonitor.py -vv -t n -n eth0.

The output (with redacted MAC) is

append: False
baudrate: 115200
commands:
datasource: network
follow: False
interface: {17: [{'addr': 'xx:xx:xx:xx:xx:xx', 'broadcast': 'ff:ff:ff:ff:ff:ff'}], 2: [{'addr': '192.168.100.1', 'netmask': '255.255.255.0', 'broadcast': '192.168.100.255'}]}
keyfile: None
logfile: stderr
master: False
outfile: stdout
ports: 22222,22221,80
record: None
slaves:
type: n
updatefile: None
verbose: 2
xerror: False
opening network
starting dhcpThread
Exception in thread dhcpThread:
starting dnsThread
Traceback (most recent call last):
waiting for connection on port 22222
  File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
waiting for DNS message
waiting for connection on port 22221
    self.run()
waiting for connection on port 80
  File "/usr/lib/python3.10/threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "/home/alarm/aur_builds/solaredge/se/network.py", line 248, in dhcp
    clientIpAddrNum = ipAddrNum[0:3] + chr(ord(ipAddrNum[3]) + 1)
TypeError: ord() expected string of length 1, but int found

I started tinkering with it, by removing the ord(), as I read that it is a python2 leftover, but I don't know enough about python to fix the whole script so I stopped after a few hurdles. I read this project was adjusted for python3 so I don't know what is wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant