Hi

check the pyusb version on each os.  this is due to a difference in the 
pyusb version, not jessie vs stretch.

I am using the same usb utility u wrote to test the 4 port usb hub using 
either stretch or jessie.
It works on jessie but not on stretch as shown below. (the hardware remains 
the same)

pi@weatherpi:~/Desktop $ sudo python usb_control-0.6.py --hub 001:005 
--port 4 --indicator 0
Traceback (most recent call last):
  File "usb_control-0.6.py", line 190, in <module>
    main()
  File "usb_control-0.6.py", line 185, in main
    docmd(CMD_INDICATOR, options.hub, options.port, options.indicator)
  File "usb_control-0.6.py", line 136, in docmd
    devid = "%s:%03d" % (bus.dirname, dev.devnum)
TypeError: %d format: a number is required, not NoneType
pi@weatherpi:~/Desktop $ lsusb
Bus 001 Device 006: ID 1941:8021 Dream Link WH1080 Weather Station / USB 
Missile Launcher
Bus 001 Device 005: ID 0409:0058 NEC Corp. HighSpeed Hub
Bus 001 Device 004: ID 045e:0745 Microsoft Corp. Nano Transceiver v1.0 for 
Bluetooth
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 
Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

So I am confused now, u mentioned pyusb 1.x, ........ so is this your usb 
utility (later version) or some other code supplied with the os???   and 
how do I check.
I am only using your usb utility (usb_control-0.6.py) as a test, I rely on 
weewx fousb to do power cycling in the event of a usb lockup.
The log shows *Nov  6 18:23:36 weatherpi weewx[2689]: fousb: found station 
on USB bus= device=*
So is this pyusb code issue or weewx fousb issue??

you should be able to run debian9 (stretch) if you install pyusb 0.4
So how do I get (stretch version) weewx using fineoffset usb driver to use 
pyusb 
0.4 to power cycle a usb port lockup?

So with a limited understanding so far, using the log below, weewx fousb 
(fineoffset usb driver) is attempting a power cycle of a locked up usb port 
but cannot do it because of
*Nov  6 18:23:36 weatherpi weewx[2689]: fousb: found station on USB bus= 
device= *(for the reason u mentioned above.....no numbers)
this would indicate that weewx fousb (fineoffset usb driver) uses the same 
principles as your earlier versions of usb utility.
 
Nov  9 07:08:50 weatherpi weewx[3742]: fousb: Attempting to power cycle
Nov  9 07:08:50 weatherpi weewx[3742]: engine: Caught unrecoverable 
exception in engine:
Nov  9 07:08:50 weatherpi weewx[3742]:     ****  %d format: a number is 
required, not NoneType
Nov  9 07:08:50 weatherpi weewx[3742]:     ****  Traceback (most recent 
call last):
Nov  9 07:08:50 weatherpi weewx[3742]:     ****    File 
"/usr/share/weewx/weewx/engine.py", line 871, in main
Nov  9 07:08:50 weatherpi weewx[3742]:     ****      engine = 
engine_class(config_dict)
Nov  9 07:08:50 weatherpi weewx[3742]:     ****    File 
"/usr/share/weewx/weewx/engine.py", line 78, in __init__
Nov  9 07:08:50 weatherpi weewx[3742]:     ****      
self.loadServices(config_dict)
Nov  9 07:08:50 weatherpi weewx[3742]:     ****    File 
"/usr/share/weewx/weewx/engine.py", line 142, in loadServices
Nov  9 07:08:50 weatherpi weewx[3742]:     ****      
self.service_obj.append(weeutil.weeutil._get_object(svc)(self, config_dict))
Nov  9 07:08:50 weatherpi weewx[3742]:     ****    File 
"/usr/share/weewx/weewx/engine.py", line 467, in __init__
Nov  9 07:08:50 weatherpi weewx[3742]:     ****      if software_interval 
!= self.engine.console.archive_interval:
Nov  9 07:08:50 weatherpi weewx[3742]:     ****    File 
"/usr/share/weewx/weewx/drivers/fousb.py", line 991, in archive_interval
Nov  9 07:08:50 weatherpi weewx[3742]:     ****      return 
self._archive_interval_minutes() * 60
Nov  9 07:08:50 weatherpi weewx[3742]:     ****    File 
"/usr/share/weewx/weewx/drivers/fousb.py", line 1006, in 
_archive_interval_minutes
Nov  9 07:08:50 weatherpi weewx[3742]:     ****      
power_cycle_station(self.pc_hub, self.pc_port)
Nov  9 07:08:50 weatherpi weewx[3742]:     ****    File 
"/usr/share/weewx/weewx/drivers/fousb.py", line 715, in power_cycle_station
Nov  9 07:08:50 weatherpi weewx[3742]:     ****      devid = "%s:%03d" % 
(bus.dirname, dev.devnum)
Nov  9 07:08:50 weatherpi weewx[3742]:     ****  TypeError: %d format: a 
number is required, not NoneType
Nov  9 07:08:50 weatherpi weewx[3742]:     ****  Exiting.

So how do I get weewx fineoffset usb driver to power cycle a locked up usb 
port..........or am I missing something??
Thanks




On Friday, 9 November 2018 09:52:32 UTC+10, mwall wrote:
>
> On Thursday, November 8, 2018 at 5:22:01 PM UTC-5, Ian Prescott wrote:
>>
>> sad news, weewx (stretch version) crashed this morning. It had been 
>> running for more than 24hrs.
>> I am at the end of my abilities and ask for some pointers on how to find 
>> a solution.
>> I have restored the jessie version on the raspberry pi.
>> Thanks 
>> Ian
>>
>
> the failure you posted is due to the fact that pyusb 1.x reports None for 
> both bus and device
>
> you should be able to run debian9 (stretch) if you install pyusb 0.4
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to