-
Notifications
You must be signed in to change notification settings - Fork 6
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
Cant Use The Test Code #5
Comments
Hum, that a very old project... not used anymore.
I would say
1) upgrade the digimat.espa module to the 0.1.14 version (just posted yet)
pip install -U digimat.espa
2) open a terminal on the same machine and run a local debug monitor with
"python -m digimat.logserver", assuming you have first installed the
"digimat.logserver" module (pip install -U digimat.logserver). Then start
your client (on the same machine). The client will forward logging through
a local tcpip connexion to the debugger monitor.
When you start your espa client, you should see something good/wrong on the
logger.
Maybe that your client simply can't open the com port. Start with 1 server
(only).
Good luck,
Frederic
Le jeu. 24 nov. 2022 à 11:37, aboamo ***@***.***> a écrit :
… Hello,
I am new to ESPA 4.4.4. I started 2 virtual Serial Ports (COM29 and
COM30). Then i ran your test code and i see nothing happening even when i
send string data to COM29 or COM30. Could you please help ?
from digimat.espa import LinkSerial, Server, MultiChannelServer
class MyMultiChannelServer(MultiChannelServer):
def onNotification(self, notification):
print (notification)
if notification.isName('calltopager'):
print ("[%s]->paging(%s, %s)" % (notification.source,
notification.callAddress,
notification.message))
servers=MyMultiChannelServer()
link=LinkSerial('ts940', 'COM29', 9600, 'N', 8, 1)
servers.add(Server(link))
link=LinkSerial('espa2', 'COM30', 9600, 'N', 8, 1)
servers.add(Server(link))
servers.run()
—
Reply to this email directly, view it on GitHub
<#5>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABXU4MJG7JUWNJG6P5KL7XDWJ5AQLANCNFSM6AAAAAASKGSQ2E>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Hum, the string -> bytearray conversion seems to be buggy (this has been
done to migrate from python2 -> python3). This has not been tested, since
unused ;(
I have quickly pushed a fix (maybe?) but i can't test it -- not tested, not
working ;(
Could you try to upgrade the module version (.15) and retry to see if that
works ?
Le jeu. 24 nov. 2022 à 14:00, aboamo ***@***.***> a écrit :
… Thank you for your reply. Your answer helped me further.
The server says it is waiting for <1> and when i send it, it gives me this
in debug window
2022-11-24 13:50:23 ESPA-SERVER:espa2 setServerState(1)
2022-11-24 13:50:23 ESPA-SERVER:espa2 WAITING FOR <1>
2022-11-24 13:50:24 ESPA-SERVER:espa2
RX[45:58:00:00:00:0F:00:00:22:3C:31:3E:22]
2022-11-24 13:50:24 ESPA-SERVER:espa2 >EOT
2022-11-24 13:50:24 ESPA-SERVER:espa2 run()
Traceback (most recent call last):
File
"C:\Users\amahmoud\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\digimat\espa\espa.py",
line 422, in _manager
self.stateMachineManager()
File
"C:\Users\amahmoud\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\digimat\espa\espa.py",
line 364, in stateMachineManager
if self.waitChar(self._controlEquipmentAddress):
File
"C:\Users\amahmoud\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\digimat\espa\espa.py",
line 346, in waitChar
self.resetState()
File
"C:\Users\amahmoud\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\digimat\espa\espa.py",
line 333, in resetState
self.channel.eot()
File
"C:\Users\amahmoud\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\digimat\espa\espa.py",
line 126, in eot
self.sendChar(ESPA_CHAR_EOT)
File
"C:\Users\amahmoud\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\digimat\espa\espa.py",
line 118, in sendChar
self.send(bytearray(c))
TypeError: string argument without an encoding
2022-11-24 13:50:24 ESPA-SERVER:espa2
close(COM29)
[image: image]
<https://user-images.githubusercontent.com/92148477/203790270-14e855bf-8c87-4f4a-8f0a-89e40a16b4ba.png>
—
Reply to this email directly, view it on GitHub
<#5 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABXU4MK3EAJPPJQKSFMLW2LWJ5RIRANCNFSM6AAAAAASKGSQ2E>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
ok, not the good way to to it ;(
and now with version .16 ?
Le jeu. 24 nov. 2022 à 15:02, aboamo ***@***.***> a écrit :
… Thank you for the quick answer, unfortunately Another Problem showed up
[image: image]
<https://user-images.githubusercontent.com/92148477/203802838-95d0278c-3f6e-4485-b7d5-bb3a2c282048.png>
—
Reply to this email directly, view it on GitHub
<#5 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABXU4MK6QTAFCEFVVBEVW7DWJ5YRDANCNFSM6AAAAAASKGSQ2E>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
The Previous Problems seem to have been solved. Yet i dont receive any response from the server and i dont understand if i am sending the messages right. All I am doing currently is i am sending 1<ENQ>. is that normal to get no response even if the server wrote TX[04]? Could you maybe comment an example espa message that the server would expect ? |
;) it seems that you send '1' (correct) and then 'E', 'N', 'Q' ... this is
not correct.
ENQ is a single char (0x5) !
[image: Screenshot 2022-11-24 at 15.22.35.jpg]
I have joined the espa444 protocol.
Le jeu. 24 nov. 2022 à 15:19, aboamo ***@***.***> a écrit :
… The Previous Problems seem to have been solved. Yet i dont receive any
response from the server and i dont understand if i am sending the messages
right.
All I am doing currently is i am sending 1<\ENQ>. is that normal to get no
response even if the server wrote TX[04]?
[image: image]
<https://user-images.githubusercontent.com/92148477/203805989-eff5443d-6b22-49da-b3ef-9d71a8bcdbca.png>
—
Reply to this email directly, view it on GitHub
<#5 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABXU4MNGHWDPEMTPNUGA5KTWJ52NNANCNFSM6AAAAAASKGSQ2E>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Wow thank you for explaining that :) Now it works. Thank you again !! |
so i have tried to send this message my code: |
Ok, same kind of python2->python3 error (bytearray/string)
I made a patch (.17), but this may be not the last one.
Le jeu. 24 nov. 2022 à 15:59, aboamo ***@***.***> a écrit :
… so i have tried to send this message
119992FIRE SEC 123
and the following error appeared:
[image: image]
<https://user-images.githubusercontent.com/92148477/203814135-ac7204ce-ac67-4032-8f32-05baa0e974e5.png>
my code:
msg.payload = "1" + String.fromCharCode(0x5) + "2" +
String.fromCharCode(0x5) + String.fromCharCode(0x1) + "1" +
String.fromCharCode(0x2) + "1" + String.fromCharCode(0x1F) + "999" +
String.fromCharCode(0x1E) + "2" + String.fromCharCode(0x1F) + "FIRE SEC
123" + String.fromCharCode(0x03)
//119992FIRE SEC 123
—
Reply to this email directly, view it on GitHub
<#5 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABXU4MMVGBWYJEKCR3SEBYDWJ57GRANCNFSM6AAAAAASKGSQ2E>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
This module is a "espa server" so you have to use an espa client to send a
message to it.
When the server has received a message, it's up to you to dispatch it to
how you want.
This is not an espa client.
Le ven. 25 nov. 2022 à 12:35, aboamo ***@***.***> a écrit :
… Thank you very much for the patches.
how to use your code to send a message to another espa station ? even with
threading it wont work.
[image: image]
<https://user-images.githubusercontent.com/92148477/203977178-36354f8c-99d6-45c3-982b-050cb2aaaeae.png>
—
Reply to this email directly, view it on GitHub
<#5 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABXU4MJVINNOOEQCQCL7SWDWKCQB3ANCNFSM6AAAAAASKGSQ2E>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Hello,
I am new to ESPA 4.4.4. I started 2 virtual Serial Ports (COM29 and COM30). Then i ran your test code and i see nothing happening even when i send string data to COM29 or COM30. Could you please help ?
from digimat.espa import LinkSerial, Server, MultiChannelServer
class MyMultiChannelServer(MultiChannelServer):
def onNotification(self, notification):
print (notification)
if notification.isName('calltopager'):
print ("[%s]->paging(%s, %s)" % (notification.source,
notification.callAddress,
notification.message))
servers=MyMultiChannelServer()
link=LinkSerial('ts940', 'COM29', 9600, 'N', 8, 1)
servers.add(Server(link))
link=LinkSerial('espa2', 'COM30', 9600, 'N', 8, 1)
servers.add(Server(link))
servers.run()
The text was updated successfully, but these errors were encountered: