carbonsphere / uhppote Goto Github PK
View Code? Open in Web Editor NEWNetwork Communication Class
Network Communication Class
Hi Carbon Sphere,
Thanks for working on a PHP UHPPOTE door controller. Happy to buy you a beer/send some bucks your way. You have PayPal account?
Anyhow on to the issue/problem.
1) To start I load example.php
I get as I should a nice statement of "Please set Serial number before start"
2) I go an enter my HEX SN into UHPPOTE.php
private $sn = 193927D6;
https://www.screencast.com/t/1SUYvfEvn
3) Reload example.php and I get a 500 error. I check the logs and find this:
PHP Parse error: syntax error, unexpected 'D6' (T_STRING), expecting',' or '<' ... line 5
https://www.screencast.com/t/379rEnFYFqN9
Note how it's not liking the D6 of my HEX address/sn.. If I change D to say 4 I get the "Please set SN" message. But using any letter makes it error.
Note: PHP Ver on all systems is 5.6
Any help or ideas would be much appreciated!
/Shane
@carbonsphere Have you experimented with the Task List feature?
When using the Uhppote.php file outside of a command line terminal using the
$cmd = $a->getCmdHex($argv[3], $dt, $data);
command the $data
variable that stores the door number when using the open_door
command changes the door value from 01, 02, 03 or 04 to 1, 2, 3, 4 causing the HEX conversion to not be valid length, to fix this we can check the value on on input at line 751 of of the Uhppote.php file from
$hexStr .= (isset($param['door']) ? $param['door'] : '01');
to
$hexStr .= (isset($param['door']) ? ((substr($param['door'], 0, 1) == 0) ? $param['door'] : 0 . $param['door']) : '01');
we use substr to check if the input begins with a '0' and if not then we pad it with a '0' before using it.
This is my first time submitting an issue on Github, so if Im doing this all wrong I apologize just let me know. :)
I've been able to poll the controller with 'dev_staus' and get good info back
Padding 56 Send the following command to network 17200000F5AD38190000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 Listening for return status Processing return status Array ( [index] => 5645 [swipeRecord] => 02 [noaccess] => 01 [doornum] => 02 [dooropen] => 01 [cardid] => 3955487144 [swipeymdhms] => 2019-10-05 09:35:13 [swipereason] => 2c [door1stat] => 01 [door2stat] => 01 [door3stat] => 01 [door4stat] => 01 [door1button] => 00 [door2button] => 00 [door3button] => 00 [door4button] => 00 [systemstat] => 00 [systemtime] => 09:35:28 [packetserial] => 00000000 [backup] => 00000000 [specialmsg] => 00 [battery] => 00 [fire] => 00 [systemdate] => 2019-10-05 )
When I try to write via open_door, depending upon my format of the door number (leading zero) I'm met with an 'error/success' or 'unable to process' errors.
Door: 2Array ( [door] => 2 ) Open Door Padding 55.5 Send the following command to network 17400000F5AD381920000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 There is an error: 0 -- Success
Door: 02Array ( [door] => 02 ) Open Door Padding 55 Send the following command to network 17400000F5AD38190200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 Listening for return status Processing return status Error: unable to process command. Unknown. 64 Array ( )
Either way - I'm not getting an unlock command to the controller. Am I missing something?
(I'm running a linux disty on a Pi3 now)
thanks
lee
Hey there,
I'm working towards a remote unlock solution via my webserver. I keep getting the error below, regardless of the command issued ('get_ripp','dev_status','open_door'). I'm starting to wonder if it's my serial number and I just don't have a connection. There's a number on the board and there's the mac address - I've entered both in various degrees and directions. My server is IIS with PHP7.
thanks for any help,
lee
Padding 56 Send the following command to network 179200004C1439190000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 Sending.... Listening for return status
Warning: socket_recv(): unable to read from socket [10045]: The attempted operation is not supported for the type of object referenced. in C:\xxx\yyy\zzz.php on line 64
Receive socket Error: [10045] The attempted operation is not supported for the type of object referenced.
I am happy with this examples, but if I want to use monitor.php, I receive following message in my webbrowser
Listening for return status Processing return status bool(true) Could not bind socket : [98] Address already in use
PHP is running on my Raspberry Pi.
/*
* The ip address and port of this machine tht will receive
* monitor messages
*/
$localip = "192.168.1.100"; // is this the IP-Address of my Raspberry Pi = ????
$localport = 60003;
What can I try to get the monitoring work?
I'm having a problem when trying to run example.php (or any file where it's sending). This is the error that is being thrown:
Warning: hex2bin(): Hexadecimal input string must have an even length
Dear Carbon!
Thank you for developing the wiegand code. I have problems accessing my controller board, search.php finds the board but I can't get anwers by the other scripts.
E.g. getRecordExample.php hangs at "Listening for return status" and there is no return, even I handle with RFID-cards at the readers.
Padding 56 Send the folling command to network 17b40000348413230000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 Sending.... Listening for return status
I'm not sure about the serial number, because in my case a have a sticker with 9 digits decimal serial number, and these are other digits than the mac-adress.
When I use the serial number from the label, I get the message:
PHP Warning: hex2bin(): Hexadecimal input string must have an even length in /root/UHPPOTE-master/getRecordExample.php on line 41
Sending....
There is error
Also the windows-software Wiegand Access shows me the number on the label and different MAC, when it has found the access controller in the network. This is the output from the Access software:
Entrace
Door Status: Open
Door Control: OnLine
Door_Delay(Sec): 4
SN: 423138434
IP:
--Swipes: 12
--Privielges: 3
--RealClock: 2019-08-06 22:30:07 Dienstag
--Firmware Version: V6.62 [2015-12-15]
--MAC: 00-66-19-38-94-82 [100M]
---- Enabled ----
--Record Button Events
--Record Door Status Events
--Record Warn Events
---Threate Code-Invalid Card Reader
The search.php code works and finds the controller with this output:
Padding 60 Send the folling command to network 17940000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 Sending.... Listening for return status Processing return status array(8) { ["cmd"]=> string(6) "search" ["ip"]=> string(14) "192.168.15.120" ["mask"]=> string(13) "255.255.255.0" ["gate"]=> string(12) "192.168.15.1" ["mac"]=> string(17) "00-66-19-38-94-82" ["ver"]=> string(4) "0662" ["date"]=> string(8) "20151215" ["sn"]=> string(8) "19389482" } Success!
Hopefully you can help me and tell me something about compatibility of my controller. Here is a picture from the board:
https://abload.de/img/img_20190806_221644xkjfv.jpg
Thank You!
fleptino
Hi, I've send this:
php -f sendCommand.php set_ip
This is output:
Padding 40
Script doesn't end fine.
Can you help me?
I need to restart/reboot UHPPOTE controller from command line. Is there any way that I could send a command to UHPPOTE controller to restart/reboot it. Your kind help and support will be highly desirable.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.