[beagleboard] Re: Beagle expertise needed

robertsmaria934 , there appears to be no text in your message.

William Hermans, I can assure you that I started with a simple unit file nearly exactly as you had offered. Knowing little about Linux, I somewhat blindly added guesses on additional commands, but with no improvement. And just to be sure, I followed your instructions to the tee. I used,
ln /lib/systemd/imuout.service imuout.service
to create the link. But I had the same result/error message when I attempt to enable the service.

William Hermans, I can assure you that I started with a simple unit file nearly exactly as you had offered. Knowing little about Linux, I somewhat blindly added guesses on additional commands, but with no improvement. And just to be sure, I followed your instructions to the tee. I used,
ln /lib/systemd/imuout.service imuout.service
to create the link. But I had the same result/error message when I attempt to enable the service.

Except you didn’t follow my instructions to the tee.

I gave no such instructions to do this:

ln /lib/systemd/imuout.service imuout.service

The file must physically be located in /lib/systemd/system/. Not a link to another file, not in a different directory. /lib/systemd/system/imuout.service

okay, fair enough, although everything on line states to create a symlink. Anyway, I found the error – if you look at my cut/paste, you’ll notice {install] – should be [Install].
I was manually copying from my ipad. Knew it was a bad idea at the time.
Thanks

okay, fair enough, although everything on line states to create a

symlink. Anyway, I found the error -- if you look at my cut/paste, you'll
notice {install] -- should be [Install].

I was manually copying from my ipad. Knew it was a bad idea at the time.
Thanks

So keep in mind when I say it bugs the s**t out of me when someone says
they followed my instructions when they fail to duplicate my results.
Because I test everything, and put that test, and instructions in a text
file. As it happens, I had just done this yesterday, for a client's system
. . .

Additionally. “Everything” online hasn’t worked out for you yet, Has it ? I’ve tested what I’ve done. It works with:

root@beaglebone:~# uname -r
4.4.38-bone-rt-r14
root@beaglebone:~# cat /etc/dogtag
BeagleBoard.org Debian Image 2016-06-19
root@beaglebone:~# systemctl status log-halt.service
● log-halt.service - Halt logger
Loaded: loaded (/lib/systemd/system/log-halt.service; enabled; vendor preset: enabled)
Active: inactive (dead)
root@beaglebone:~# systemctl status log-reboot.service
● log-reboot.service - Reboot logger
Loaded: loaded (/lib/systemd/system/log-reboot.service; enabled; vendor preset: enabled)
Active: inactive (dead)

Which “logging” system going down is actually a small part of the services. So again, I know what I said will work for you, because it works for me. It has to work, otherwise I don’t get paid. The only thing I don’t know for your case, is what target you need to hook off of. It could be network.target, network-online.target, or any other number of network related target I'm unaware of. It could even be more than one target simultaneously.

So in the future, do me a favor. I took time out of my life to try and help you fix your problem. Do me the service of at least doing exactly as I mentioned, before you try to discredit what I’m saying works. Maybe, that was intentional, maybe not. I honestly don’t care. Because I do not get paid trying to help you with your problem.

Also, there may even be many ways, or slightly similar ways to do the same thing. Maybe creating a symbolic file link will work ? But if I’m instructing someone to do something the way I know how, and they’re off in left field somewhere, complaining that what I’m trying to instruct doesn’t work . . . well at some point, I’m just going to stop caring if they find a solution or not.

Hey, language. There are kids on the internet. BTW, your .service file had the same bug with a small ‘i’ in Install, so it would not have worked anyway. But as you said in your later post, you’re not getting paid, so I’m not here to quibble.

Anyway, I enabled the service, but it won’t start due to some internal error:

root@beaglebone:/tinkerforge/Example_project# systemctl start imusend.service
Job for imusend.service failed because the control process exited with error code.
See “systemctl status imusend.service” and “journalctl -xe” for details.
root@beaglebone:/tinkerforge/Example_project# systemctl status imusend.service
â imusend.service - imu output
Loaded: loaded (/lib/systemd/system/imusend.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2017-01-22 00:25:54 UTC; 16s ago
Process: 7219 ExecStart=/usr/bin/imuout.sh (code=exited, status=1/FAILURE)
Main PID: 7219 (code=exited, status=1/FAILURE)

Jan 22 00:25:54 beaglebone imuout.sh[7219]: <type ‘exceptions.TypeError’>: ‘NoneType’ object is not callable
Jan 22 00:25:54 beaglebone imuout.sh[7219]: Traceback (most recent call last):
Jan 22 00:25:54 beaglebone imuout.sh[7219]: File “/usr/lib/python2.7/threading.py”, line 810, in __bootstrap_inner
Jan 22 00:25:54 beaglebone imuout.sh[7219]: File “/usr/lib/python2.7/threading.py”, line 763, in run
Jan 22 00:25:54 beaglebone imuout.sh[7219]: File “/usr/local/lib/python2.7/dist-packages/tinkerforge/ip_connection.py”, line 687, in receive_loop
Jan 22 00:25:54 beaglebone imuout.sh[7219]: <type ‘exceptions.TypeError’>: ‘NoneType’ object is not callable
Jan 22 00:25:54 beaglebone systemd[1]: imusend.service: Main process exited, code=exited, status=1/FAILURE
Jan 22 00:25:54 beaglebone systemd[1]: Failed to start imu output.
Jan 22 00:25:54 beaglebone systemd[1]: imusend.service: Unit entered failed state.
Jan 22 00:25:54 beaglebone systemd[1]: imusend.service: Failed with result ‘exit-code’.
root@beaglebone:/tinkerforge/Example_project#

The shell file runs fine when I call it from the terminal: /usr/bin/imuout.sh

But the system won’t run it as a service for some reason.

/usr/local/lib/python2.7/dist-packages/tinkerforge/ip_connection.py", line 687 simply reads:

while self.receive_flag:
try:
data = self.socket.recv(8192)
except socket.error:
if self.receive_flag:
e = sys.exc_info()[1]
if e.errno == errno.EINTR:
continue

self.handle_disconnect_by_peer(IPConnection.DISCONNECT_REASON_ERROR, socket_id, False)
break

687 if len(data) == 0:
if self.receive_flag:
self.handle_disconnect_by_peer(IPConnection.DISCONNECT_REASON_SHUTDOWN, socket_id, False)
break

pending_data += data

This may be a bug in Python 2.7: http://bugs.python.org/issue14623

Per one recommendation:

The most simple workaround is to add timeout

time.sleep(1)

in the end of script that allows the threads to finish before the script comes to end of life and close

Haven’t figured out where to put a time.sleep(1) line.

so it would not have worked anyway.

That was not my script, that was your service edited, with all the
unnecessary stuff removed. Copy-pasted.

Obviously

Hi Richard. sorry for the late reply. Did you solve this problem? Use a zigbee cape.
Your data rates are quite low, so this should be no problem and their range and
robustness is much better than wifi.
later…dd

Thanks – worked it out as planned