As the title says... Chat on...

User avatar
By criscampos
#11813 Hi, I'm looking to send hex commands to a fingerprint sensor connected to a cp2101 board.
For that, i'm trying the following code (The sensor works only in 115200):

Code: Select all    uart.setup( 0,115200,8,0,1,0 )
    srv=net.createServer(net.TCP)
    srv:listen(80,function(conn)
       conn:on("receive",function(conn,payload)
          uart.write( 0, "0x55AA24010200010000000000000000000000000000002701")
          conn:send("<h1> Turning on LED.</h1>")
          end)
       conn:on("sent",function(conn) conn:close() end)
       end)


Is it ok to send an hex command in that way? What could be wrong?
User avatar
By criscampos
#11877 Hi Gerry, thank you for your reply, I've tried and it worked perfectly.

It is just a little tedious to write every byte of 15 bytes-length command (I have to pass like 10 of this commands), but is the only way..

Thanks again!