simat / modbus-tk

Automatically exported from code.google.com/p/modbus-tk
Other
0 stars 0 forks source link

hmi throws an exception if serial is not available #9

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Don't install pyserial
2. run master_webhmi.py
3.

What is the expected output? What do you see instead?
master_webhmi should run the webserver.  I see the following exception.

modbus_tk_svn\hmi>python master_webhmi.py
Warning: serial communication is disabled
Traceback (most recent call last):
  File "master_webhmi.py", line 29, in <module>
    serial.Serial(port=SERIAL)
NameError: name 'serial' is not defined

D:\kgray\My Documents\Software\modbus_tk_svn\hmi>

What version of the product are you using? On what operating system?
Using trunk revision on Windows XP SP3

Please provide any additional information below.
See attached patch for potential fix.

Original issue reported on code.google.com by idahog...@gmail.com on 29 Jun 2010 at 1:58

Attachments:

GoogleCodeExporter commented 9 years ago
I agree that webhmi should be able to run without pyserial. An 'except' is 
missing somewhere. I'll try to fix that asap
Best 

Original comment by luc.jean@gmail.com on 29 Jun 2010 at 3:15

GoogleCodeExporter commented 9 years ago
In fact, I think taht this line of code was there by mistake. It was not 
removed after a test. The serial port opening is managed properly line 55

Original comment by luc.jean@gmail.com on 30 Jun 2010 at 5:24

GoogleCodeExporter commented 9 years ago
Fixed on rev 115. Please review it

Original comment by luc.jean@gmail.com on 30 Jun 2010 at 5:37