Printer Status Monitoring adobe AIR Desktop App - air

Want a platform independent desktop app to check the toner/Cartridge level of a network printer and notify the user of the status and give him option to request for purchase of the toner if low.
The info i got till now is that we need to fetch values for OID from MIB files of a SNMP enabled Printer. I want this app to be as generic as possible for all Brands, however need for today is specially for Brother Printers & MFPs.
Sorry for looking nube but i have searched enough and there is not much information available.
Can i use native support & Monitoring tool of the Manufacturer as brother provides its monitoring utility which can be installed on Desktop(In that case where the MIB file will be located(on the device or within installed program on the Desktop?) or need to use network monitoring tools like icanga, negios etc.
Secondly how to implement it on AIR.I am thinking to use AIR for the first time and wondering will it be helpful and do i need to know something more on this technology before proceeding.
There are some networking monitoring tools available like negios & Icinga. which can be installed even over a desktop. Can the data from these can be parsed and used. We need it for brother printer but want to implement it for Multi-Manufacturer solution as per documents format for MIB file is getting standard. We will invest time only if its universal even after a year or so as its not worth time for a single manufacturer.
So following CLI's i find useful in Net-SNMP and believe that it will get me to output by calling these Applictions by External Script(AIR).
convert between numerical and textual forms of MIB OIDs, and display MIB content and structure (snmptranslate).
A graphical MIB browser (tkmib), using Tk/perl.
A daemon application for receiving SNMP notifications (snmptrapd). Selected notifications can be logged (to syslog, the NT Event Log, or a plain text file), forwarded to another SNMP management system, or passed to an external application.
An extensible agent for responding to SNMP queries for management information (snmpd). This includes built-in support for a wide range of MIB information modules, and can be extended using dynamically loaded modules, external scripts and commands, and both the SNMP multiplexing (SMUX) and Agent Extensibility (AgentX) protocols.
Are there any API to read MIB files in AIR.
Any links or some added information is highly appreciated.

For printers without SNMP support, you'll probably have to implement a manufacturer-specific solution. If you want to write an AIR app that talks to SNMP-enabled printers, I can see the following approaches:
Implement SNMP client in ActionScript
Since SNMP is usually based on UDP, you could use flash.net.DatagramSocket to implement your own SNMP client in AIR. AFAIK, there are no ready-to-use ActionScript libraries, so you'd need expert knowledge of the SNMP protocol and a lot of development time.
Write an AIR Native Extension
With a Native Extension (ANE) you could implement the SNMP client in C/C++. This has the advantage that you could use an open source library like Net-SMTP to do the heavy lifting, but you'd still need some experience in developing and building C/C++ libraries.
Use a command-line tool
The easiest solution is probably to use one of the free SNMP command-line utilities from Net-SMTP or SnmpSoft, for example. All you have to do is to call one of these programs using flash.desktop.NativeProcess providing the correct arguments and then parse the output.

Related

Most effective way to 'listen' for data on a Mac

I am currently using a dedicated Mac Mini (OS X Yosemite) to handle mail-merges of Pages (a proprietary format) documents, that is triggered by an Applescript 'Mail-Rule' via incoming push iCloud mail.
However, relying on Mail is proving both inconsistent (will randomly miss some email) and high-latency (can take a long time for push to register even if it is supposed to be instant) — where speed is important.
What I want to achieve is a 'fast-as-possible' receipt of a small amount of data (think a 20-line JSON dictionary) on the Mac, which will then be used to trigger an Applescript action.
Therefore, is there a commonly-accepted / best-practice way of 'listening' for requests that can be sent over the web like this, to OS X? - i.e. similar to acting as a server implementing a RESTful API / a web-service.
I am literate in primarily front-end and native languages (Obj-C, Swift, JS) but am very open to learning new technologies if there is a neat and simple way of doing this.
My current train of thought is to create a native app that implements a library such as RESTEasy that will listen and act accordingly — but I was curious if there is a better way of doing this.
And yes, I have to use OS X to get this done (relying on too many proprietary processes).

Access SmartCards from Windows 8 Store App (WinRT)

In a Windows 8 Store App I would like to read Data from a SmartCard. After installing the SmartCard reader (USB Device) I can read its device path and connection state via the Windows.Devices.Enumeration namespace. Even the device interface id is retrievable (50dd5230-ba8a-11d1-bf5d-0000f805f530) and I put this as a required capability in the App's manifest file.
For the interaction with the device I use a C++ Component calling the CreateDeviceAccessInstance Method. But this call always results in an ACCESS_DENIED exception.
Further research taught me, that interacting with a custom hardware device (everything that is not a printer, microphone, mouse, ...) would need several adjustments in the device driver published to the windows 8 driver store.
I'd be glad to do so, but I am no IHV and would like to use the generic driver and the generic interface.
Could anyone give me a hint how to proceed from here and use the generic interface for USB SmartCard devices?
This is not a real answer, but I have the same problem and I have spent quite some time looking for the hard-to-find bits of information on this subject around the internet, and I'd like to share my results.
Windows 8.1 has some specific APIs for (virtual) SmartCards (API reference, sample), but it seems like they can only be used for authentication and there is no way to send APDU commands to a card at the moment (see this comment by Himanshu Soni). I guess one could use the new USB APIs to talk to the reader directly, but then you'd have to implement the whole protocol yourself.

How to program midi messages to HUI Pro Tools uses?

I found some specs online but It wouldn't work for Play.
I tried
const UInt8 noteOn[] = {0x90, 127}; and it didn't work.
Does anybody know what midi messages to HUI Pro Tools uses for play and stop?
There are 2 main Protocols out there for controlling DAWs, Logic Control and Mackie Control (HUI). Unfortunately both are close protocols. Only recently Apple added support for TouchOSC (iOS application) and the OSC protocol (Open Sound Control) in general for Logic Pro, hopefully Pro Tools to follow (maybe it already did and I'm not updated, you better check it out).
If you want to reverse engineer the record/stop buttons and you own some sort of Mackie Control device, I recommend using Midi Monitor or LC Xmu to monitor what data gets in. Not sure whats there for PC users, on my PC era I used my Pro Soundcard.
If you don't own some sort of controller and looking around the internet for the answer please notice that these protocols have many versions that each manufacture tweak a little bit. On the other hand, there are not that many options, you can try them ALL :)
Anyhow, I program an iOS application that controls Logic Pro without using LC or MC at all. I opened Logic's Key Command and set the Midi Listen button of the Start/Stop on, then sent some Midi Note from my iOS application to calibrate the button. It worked well, but was not intuitive to users so I decided to give up.
You can send a midi machine control message through your virtual server with you virtual server, I had some success after reading this: http://en.wikipedia.org/wiki/MIDI_Machine_Control
Be sure to enable your virtual source as a mmc in your DAW. Also there is a Boolean check in the core midi docs you can use to verify that your program is sending the mmc messages, I believe it is something like kmidimachinecontrolenable, it is a coremidi constant and should not be hard to find.

Is there way to tell terminal wait before send more data?

I have embedded firmware which have terminal over serial transmission. I am doing command from terminal which waits data (text file) which it should save to flash chip. However, writing flash is much slower than terminal transmission.
Text file may be pretty big (many kB), so in small embedded environment I cannot simply dump it to RAM. I though if it possible to communicate with standard terminal emulator (which have drag/dop support for files) to pause transmission every time when write buffer is full and tell continue again after write is done? I haven't find anything which may help me throught this.
Well, offcourse I can make PC frontend which understands this trick, but in basic level it should be nice if all function can be used through normal terminal if needed.
For a basic serial connection you could see if the hardware supports flow control. This would be the CTS, RTS lines (clear to send, request to send).
http://en.wikipedia.org/wiki/RS-232_RTS/CTS#RTS.2FCTS_handshaking
However many simple embedded systems do not implement this type of flow control.
If the hardware does not support flow control, then you will have to look at using some form of software flow control. You maybe able to implement the Xon/Xoff flow control ( http://en.wikipedia.org/wiki/XON/XOFF ) or could implement a simple file transfer protocol, like XMODEM, or ZMODEM, or even tftp. This depends on what your terminal can support.
I always use XMODEM when programming data into FLASH via a serial link from a PC. When using XMODEM it only sends one data packet at a time and waits for you to acknowledge the packet before sending the next one.
This means we control the flow via software on the receiving side:
Get packet ->
Write packet ->
Ack packet ->
Repeat util done...
XMODEM can be implemented on the smallest of devices (less than 1K RAM) and the code is very simple. All serial terminals support XMODEM (upto windows XP ship with an XMODEM capable terminal). XMODEM requires no special hardware.
Here is the spec.
Here is an example implementation.

Tools to monitor and debug SaaS Services

What tools will come in handy to debug and monitor SaaS services built on WCF in production environment ?
FYI - No access to the actual server whatsoever. No remoting in, and no access to the file system.
There are dozens of 'dotcom-monitors' (eg site24x7.com) but they can only monitor parameters that are publicly available, like site uptime, response times etc.
If you want to monitor memory usage and other parameters known only from 'inside', then you have two choices: either install some monitoring agent on a server (in most cases it would be a pain).
You can also send 'signals' from your code to some external event handling and notification service. I recommend AlertGrid (http://alert-grid.com) for the latter purpose it is very flexible and extremely easy to integrate.
AlertGrid doesn't require installation, access to the file system etc. it just gathers data you send and allows to build some notification rules. Examples:
you can send some parameter like memory usage and built rule 'if memory_usage > threshold -> send SMS to admin'
you can send data related to your applicatioin. If you have application proceeding orders, you can send number of processed orders in the signal and build notification rules around that
If you have some logic trigerred periodically (cron, windows service) you can send signal each time your logic is executed to check if it is executed on a scheduled basis.
(I am a developer in AlertGrid's team, in case of any question, please feel free to ask.)
What exactly do you want to monitor? If you only care about availability then good old ping might be enough :)