C
C#2y ago
reeeeeee

❔ Anyone worked with Zebra scanners?

Title. Especially FX7500 and FX9600, and maybe even Zebra IoT connector.. (before I write and explain the whole content, i would firstly like to know if anyone even worked with this, heh)
10 Replies
Patrick
Patrick2y ago
what about them
Pobiega
Pobiega2y ago
I mean, I worked with zebra printers before but it was... ~10 years ago. I remember it was a bit finicky and we had t send a lot of escape sequences to make it do "the right thing"
Patrick
Patrick2y ago
these types of questions are incredibly frustrating are you trying to integrate the EMDK? Are you just trying to scan some RFIDs onto a PC that's connected?
reeeeeee
reeeeeeeOP2y ago
I am working with Zebra IoT connector, so the Reader can send read tags to API endpoint as HTTP POST request. The basic payload looks like this
[
{
"data": {
"eventNum": 0,
"format": "epc",
"idHex": "3034211eee3d060000000006"
},
"timestamp": "2023-06-19T06:58:57.150+0200",
"type": "SIMPLE"
},
{
"data": {
"eventNum": 1,
"format": "epc",
"idHex": "3034211eee3d060000000005"
},
"timestamp": "2023-06-19T06:58:57.165+0200",
"type": "SIMPLE"
}
]
[
{
"data": {
"eventNum": 0,
"format": "epc",
"idHex": "3034211eee3d060000000006"
},
"timestamp": "2023-06-19T06:58:57.150+0200",
"type": "SIMPLE"
},
{
"data": {
"eventNum": 1,
"format": "epc",
"idHex": "3034211eee3d060000000005"
},
"timestamp": "2023-06-19T06:58:57.165+0200",
"type": "SIMPLE"
}
]
I would like to also include some data like HostName or IpAddress, but I dont find it anywhere. The configuration looks like this (https://prnt.sc/9Iv_QcblR4Nz), sadly there isnt something like hostname or Ip.
reeeeeee
reeeeeeeOP2y ago
tl;dr: When the tags are sent to the endpoint, I would like to know from which reader they came. I could set them to that Custom field in image as readerName | IP, but I hope there is any more flexible way..
Pobiega
Pobiega2y ago
is "the endpoint" software you control?
reeeeeee
reeeeeeeOP2y ago
yes
Pobiega
Pobiega2y ago
then just read the IP from the http request?
reeeeeee
reeeeeeeOP2y ago
Huh, didnt think of that.. sec, lemme try uhh, the IP is always localhost.. I tried it like this:
var ip1 = contextAccessor.HttpContext.Connection.RemoteIpAddress;
var ip2 = Request.HttpContext.Connection.RemoteIpAddress;
var ip1 = contextAccessor.HttpContext.Connection.RemoteIpAddress;
var ip2 = Request.HttpContext.Connection.RemoteIpAddress;
I also put this in startup:
app.UseForwardedHeaders(new ForwardedHeadersOptions
{
ForwardedHeaders = Microsoft.AspNetCore.HttpOverrides.ForwardedHeaders.XForwardedFor | Microsoft.AspNetCore.HttpOverrides.ForwardedHeaders.XForwardedProto
});
app.UseForwardedHeaders(new ForwardedHeadersOptions
{
ForwardedHeaders = Microsoft.AspNetCore.HttpOverrides.ForwardedHeaders.XForwardedFor | Microsoft.AspNetCore.HttpOverrides.ForwardedHeaders.XForwardedProto
});
Or does this RemoteIpAddress work properly only when deployed to the server? I also called the request from my phone, but its still 127.0.0.1... Yeah i guess thats the case..
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server