snmp oid for scanner detail(HP LaserJet 3055) - c#

How can i access scanner details (eg. HP LaserJet 3055 ) in windows service (.net framework 4.0).by using mib tree ?
Anyone please tell me the OID for getting detail such as scanner_ADF_PageCount,TotalPagesJammed,etc for scanner.
I compare each oid with "1.3.6.1.4.1.11.2.3.9.4.2.1.2.2". But still it is not giving above detail.

1) scanner-accessory-adf-sheet-count - .1.3.6.1.4.1.11.2.3.9.4.2.1.2.2.1.20.0
2) hrprinterdetectederrorstate - .1.3.6.1.2.1.25.3.5.1.2 . It returns an octet string and you need to interpret it as
Condition Bit # hrDeviceStatus
lowPaper 0 warning(3)
noPaper 1 down(5)
lowToner 2 warning(3)
noToner 3 down(5)
doorOpen 4 down(5)
jammed 5 down(5)
offline 6 down(5)
serviceRequested 7 warning(3)
I got this information from HP-LASERJET-COMMON-MIB and you can download it from here. Browse through it for more details.

Related

Change DocumentName using Ghostscript

I have requirement of changing DocumentName that is being printed. This document name will display in printer spool. I am using Ghostscript c# wrapper to print PDF. It shows "Ghostscript output" in printer spool list. Ghostscript documentation provides a way but I didn't manage to make it work.
Here in 10.2 section they described it.
https://www.ghostscript.com/doc/9.26/Devices.htm#Win
This is what I tried to run with CLI :
gswin64c.exe "D:\setup.ps" -o "D:/test.pdf" "C:\Users\ashish\Documents\tt.pdf"
Setup.ps
mark
/NoCancel true % don't show the cancel dialog
/BitsPerPixel 4 % force 4 bits/pixel
/UserSettings
<<
/DocumentName (Ghostscript document) % name for the Windows spooler
/MaxResolution 360 % maximum document resolution
>>
(mswinpr2) finddevice % select the Windows device driver
putdeviceprops
setdevice
Result:
GPL Ghostscript 9.52 (2020-03-19)
Copyright (C) 2020 Artifex Software, Inc. All rights reserved.
This software is supplied under the GNU AGPLv3 and comes with NO WARRANTY:
see the file COPYING for details.
| c:\Users\cjl\artifex\gs-release\9.52\ghostpdl-9.52\base\gsicc_manage.c:1888: gsicc_verify_device_profiles(): Mismatch of ICC profiles and device color model
| c:\Users\cjl\artifex\gs-release\9.52\ghostpdl-9.52\base\gsicc_manage.c:2015: gsicc_set_device_profile(): Error in device profiles
Error: /undefined in --.systemvar--
Operand stack:
rangecheck --dict:736/1123(ro)(G)-- .putdeviceprops
Execution stack:
%interp_exit .runexec2 --nostringval-- .systemvar --nostringval-- 2 %stopped_push --nostringval-- .systemvar .systemvar false 1 %stopped_push 1990 1 3 %oparray_pop 1989 1 3 %oparray_pop 1977 1 3 %oparray_pop 1833 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- .systemvar --nostringval-- 2 %stopped_push --nostringval-- 1831 8 3 %oparray_pop .systemvar 1814 8 3 %oparray_pop .systemvar 1808 2 3 %oparray_pop
Dictionary stack:
--dict:736/1123(ro)(G)-- --dict:0/20(G)-- --dict:75/200(L)--
Current allocation mode is local
Last OS error: Permission denied
Current file position is 430
GPL Ghostscript 9.52: Unrecoverable error, exit code 1
Thanks

Reading CI Frequency In C# With NI USB-6363

Working LabVIEW Code
Attached above is LabVIEW code that I have successfully used in the past to read frequency data from a device. I also usually use the Start Task VI between my property node and while loop.
I am trying to code this in C#. So far I have successfully been able to code analog Output's and analog Input's on my device, USB-6363, (so I know I am able to write and read data from the device successfully with C#).
I have also used multimeters (Grainger link at bottom of post) to read frequency data (Orange Hz mode that the device is set to in the picture).
However, my C# code seems to be having issues reading the frequency data. My C# code is attached. When I try running this program I get the following error. This is the same error that I get when using the example program called 'MeasDigFreqBuffCont_ExtClk_ArmStart.2013'. The code I show is just creating the task, I do call the code later in my program in a different section and that is how I am getting the error.
------------------------------------------------- Begin Error Code -------------------------------------------------
{Error=-200077 Message="Requested value is not a supported value for
this property. The property value may be invalid because it conflicts
with another property.\n\nProperty:
NationalInstruments.DAQmx.CIChannel.FrequencyDivisor\nRequested Value:
1\nPossible Values: 4 to 4294967295\nChannel Name: Digital
Frequency\n\nTask Name: _unnamedTask<0>\n\nStatus Code: -200077"}
------------------------------------------------- End Error Code --------------------------------------------------
In the example program it asks for a sample clock source (A PFI channel from the device). However in the LabVIEW code it does not ask for this. Is this example maybe more in detail than what I am trying to do?
Task frequencyInput = new Task();
frequencyInput.CIChannels.CreateFrequencyChannel(
"Dev1/ctr0",
"Digital Frequency",
200,
15000,
CIFrequencyStartingEdge.Rising,
CIFrequencyMeasurementMethod.DynamicAveraging,
0.001,
1,
CIFrequencyUnits.Hertz
);
frequencyInput.CIChannels["Digital Frequency"].FrequencyTerminal = "/Dev1/PFI0";
CounterSingleChannelReader counterFreq = new CounterSingleChannelReader(frequencyInput.Stream);
double counterFreqData = counterFreq.ReadSingleSampleDouble();
txtPFI0.Text = Convert.ToString(counterFreqData);
FLUKE (R) Fluke-115 Compact - Basic Features Digital Multimeter, 14° to 122°F Temp. Range
Formatting the error message:
Requested value is not a supported value for this property. The property value may be invalid because it conflicts with another property.
Property: NationalInstruments.DAQmx.CIChannel.FrequencyDivisor
Requested Value: 1
Possible Values: 4 to 4294967295
Task Name: _unnamedTask<0>
Status Code: -200077
According to the documentation, you are asking the device to use an invalid divisor. Change your 1 to a 4:
frequencyInput.CIChannels.CreateFrequencyChannel(
"Dev1/ctr0",
"Digital Frequency",
200,
15000,
CIFrequencyStartingEdge.Rising,
CIFrequencyMeasurementMethod.DynamicAveraging,
0.001,
/* here */ 4,
CIFrequencyUnits.Hertz
);
NI installs C# examples for DAQmx, and it includes one for measuring frequency:
C:\Users\Public\Documents\National Instruments\NI-DAQ\Examples\DotNET4.0\Counter\Measure Digital Frequency\MeasDigFrequency_LowFreq1Ctr\CS

Transferring data over bluetooth-serial module with C #

I need to transmit multiple 8-byte-packets over bluetooth-serial link. I am using JY MCU bluetooth-serial module. On the PC side, I have a C# application running that communicates with the COM port.
Considering 115200 baud, each 8 byte packet should take 8*8/115200 = 0.555 milliseconds.
The problem is that one in every 4 packets takes up to 39 milliseconds which completely destroys all the timing.
For measuring times, I am using stopwatch component of .net framework.
output from C # application:
Sample # 583 : 39.126841990471 ms
Sample # 584 : 0.7883273789593 ms
Sample # 585 : 0.93885067781563 ms
Sample # 586 : 0.884708368788226 ms
Sample # 587 : 8.65278575619526 ms
Sample # 588 : 1.05558303203074 ms
Sample # 589 : 0.870116824511337 ms
Sample # 590 : 0.888932236868378 ms
Sample # 591 : 39.0876752137277 ms
Sample # 592 : 1.02639994347697 ms
Sample # 593 : 0.820198383564084 ms
Sample # 594 : 0.960737994230964 ms
Sample # 595 : 15.2051571125331 ms
Note that each sample contains 8 bytes of data
Dogma #1: There is no such thing as a guaranteed timing in the bluetooth world.
Just consider a device dropping a frame (e.g. because your microwave oven just switched on) - the time to understand the frame as lost is substantial. Additionally the connect/disconnect as shown in your first sample is lengthy. If one of the devices uses e.g. a bluetooth mouse or is discoverable, all bets are off.
Long story short: Bluetooth messages have no consistent timing - if you want to keep timing information, include a timestamp in your payload.

FFMPEG - Scrambled Output converting from VOB with ffmpeg

I've concatenated a series of VOB files from a DVD into a single VOB file and I am trying to convert it to MP4 or other similar format. I see a lot of errors when converting and the output appears scrambled.
>ffmpeg.exe" -i file.vob -sameq file.mp4
FFmpeg version git-N-29181-ga304071, Copyright (c) 2000-2011 the FFmpeg develope
rs
built on Apr 18 2011 21:24:03 with gcc 4.5.2
configuration: --enable-gpl --enable-version3 --enable-runtime-cpudetect --ena
ble-memalign-hack --enable-avisynth --enable-bzlib --enable-frei0r --enable-libo
pencore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --
enable-libmp3lame --enable-libopenjpeg --enable-librtmp --enable-libschroedinger
--enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enabl
e-libx264 --enable-libxavs --enable-libxvid --enable-zlib --cross-prefix=i686-w6
4-mingw32- --target-os=mingw32 --arch=x86_32 --extra-cflags=-I/home/kyle/softwar
e/ffmpeg/external-libraries/win32/include --extra-ldflags=-L/home/kyle/software/
ffmpeg/external-libraries/win32/lib --pkg-config=pkg-config
libavutil 50. 40. 1 / 50. 40. 1
libavcodec 52.120. 0 / 52.120. 0
libavformat 52.108. 0 / 52.108. 0
libavdevice 52. 4. 0 / 52. 4. 0
libavfilter 1. 79. 0 / 1. 79. 0
libswscale 0. 13. 0 / 0. 13. 0
[mpeg2video # 01751A90] ac-tex damaged at 5 16
[mpeg2video # 01751A90] invalid mb type in I Frame at 0 1
[mpeg2video # 01751A90] invalid mb type in I Frame at 0 2
[mpeg2video # 01751A90] invalid mb type in I Frame at 0 3
[mpeg2video # 01751A90] invalid mb type in I Frame at 0 4
[...]
I'm guessing this is CSS scrambling and I need to do some sort of DeCSS. Does FFMpeg have an option for this? Cringe if you'd like, but is there C# source to achieve this?
My end goal is really just to get some DVDs that I own onto my media server. I've tried a few demo-ware products with limited success including Acala DVD Ripper, Click to Disk, AVIDemux to name a few. I even paid for a couple of them to get the full version, but Acala only works for about half of my DVDs and Click to Disk can decode the VOB, but I need to use FFMpeg to convert. I'd like to have it all in one app that works and I am willing to write some code for it.

.NET or COM HID iCLASS Smart Card Reader

I have coding I almost always use with my Omnikey RFID CardMan 5321 smart cards. Problem is we received new cards today which are marked "HID iCLASS GL" which do not appear to be working well with our coding.
Without going through the whole source, our problem is arising when we are calling the following line, which basically tells us the length of the data:
lResult = SCardTransmit(hCard, 0, bytCommand, lLen, 0, byReadBuffer, iReturnlength)
We are returning only a length of 2, which the data is marked as "x69 x86". Even if I tell it to read all 255 chr's the rest are just marked as null.
Now I know our reader can read these cards since the OMNIKEY Diagnostic tool is showing us the following:
Status: Smart Card Inserted
FW: 5.10
Port: USB
Lib: 1.0
Smart Card Nme: iCLASS 32KS 8x2+16
ART: Valid
Protocol: ISO 15693 (Part 2)
PICCtoPCD: 26,48 kbps
PCDtoPICC: 26,48 kbps
Frequ: 13.56 MHz
As I explained before, everything is working fine in my coding except no data is being returned for my card besides "x69 x86", which is surely not correct.
If anyone has any experience reading from a HID iCLASS card, I would greatly appreciate some feedback on how to. Even if we have to license software, that is ok.
Thanks in advance!
in case you are trying to access physical access data, I would thoroughly check the crypto protocol between reader and host first and also meke sure you are using a reader with teh latest firmware (5.20 for the OMNIKEY 5321).
I would also introduce code to check the card system withour secure communication channel between host and reader application.
Further references:
http://www.hidglobal.com/documents/ok_contactless_developer_guide_an_en.pdf
The reason cause you get a 2 Byte array is cause your command runs on an error so the chip returns only SW1 and SW2 Flag
in your case it's meaning is
x69 --> Command not allowed (further qualification in SW2, see table 17)
x86 --> Command not allowed (no current EF)
So you might proof that your application file on the chip is correctly selected
further information #
http://www.cardwerk.com/smartcards/smartcard_standard_ISO7816-4_5_basic_organizations.aspx#table17

Categories

Resources