vne147
Member
All,
I was hoping that you could provide me with some advice and guidance on a project I’ll be starting soon. I’m building a device that I will connect in between a POS (point of sale) computer and a receipt printer. The idea is that whenever the POS computer tries to print a receipt, this box will intercept it and send it to a remote server via the internet. Based on some separate software I’m developing, after a few seconds the remote server will reply to the device. Depending on the response, the device will either send the data on to the receipt printer or not.
The box will have a DB-9 connector for RS-232 input from the POS computer, a DB-9 connector for RS-232 output to the receipt printer, a WiFi board from MikroE (I haven’t decided which one yet), and a MicroSD card.
A slightly more detailed explanation of the overall concept follows (refer to the diagram):
For this project I’m looking at using the PIC18F66J94 because it has 4 built in UART modules. I’ll need at least 3 (2 for the RS-232 and 1 for the MicroSD card) and I may need a 4th depending on which WiFi board I go with. I know I can get UART IC that I can interface to the MCU via SPI but I think it would be simpler to have everything built into the MCU.
So, my questions are:
I was hoping that you could provide me with some advice and guidance on a project I’ll be starting soon. I’m building a device that I will connect in between a POS (point of sale) computer and a receipt printer. The idea is that whenever the POS computer tries to print a receipt, this box will intercept it and send it to a remote server via the internet. Based on some separate software I’m developing, after a few seconds the remote server will reply to the device. Depending on the response, the device will either send the data on to the receipt printer or not.
The box will have a DB-9 connector for RS-232 input from the POS computer, a DB-9 connector for RS-232 output to the receipt printer, a WiFi board from MikroE (I haven’t decided which one yet), and a MicroSD card.
A slightly more detailed explanation of the overall concept follows (refer to the diagram):
- Once a transaction completes, the POS will try to send data to the receipt printer so it can print out a receipt but, my device will be in the way. My device will read each byte of data via the first DB-9 connector as it is received from the POS computer. As soon as it is received, The MCU writes it to a file on the MicroSD card.
- Once the POS computer has completed sending all the data, the device immediately sends the file from the MicroSD card to a remote server via a WiFi board.
- After the remote server receives the file and looks at it, 1 of 3 things will happen:
- a. The remote server will tell the device to not print the receipt.
- b. The remote server will tell the device to print the receipt and the device will read the original data from the file and send it to the receipt printer via the second DB-9 connector.
- c. If 3 seconds elapse and no reply has been received from the remote server, the device reads the original data from the file and sends it to the receipt printer via the second DB-9 connector.
- The device erases the file written to the MicroSD card and waits for the next receipt from the POS computer.
For this project I’m looking at using the PIC18F66J94 because it has 4 built in UART modules. I’ll need at least 3 (2 for the RS-232 and 1 for the MicroSD card) and I may need a 4th depending on which WiFi board I go with. I know I can get UART IC that I can interface to the MCU via SPI but I think it would be simpler to have everything built into the MCU.
So, my questions are:
- Does anyone see any problems with the concept overall? Will it work? Not work? Is there a better way?
- Can I use the PIC18F66J94 with the MikroE WiFi library? When I unpacked it, I didn’t see that specific processor in the list.
- What protocol can I use to send a file to a server from the device? I know this can be done with FTP but I didn’t see any examples for that. I saw examples for HTTP but I’m not sure if I can do file transfer with that. I don’t have a lot of experience with internet protocols. Almost all of my programming experience is embedded and standalone desktop.