Hi,
I need some help on my Arduino code to retrieve the image data from the uCam ttl and save as a jpeg file.
1) I have managed to retrieve Jpeg format data of package size 50. The image size from the ucam shows 4FO = 1264. The number of packages should be around 25 or 26. How can I write in code to get 1264 out of the hexdecimal 4FO?
2) The received Jpeg data needs to remove the first 4 byte and the next 50 byte would be the Jpeg data. This data is obtained from the serial port, how can I parse the data to read this 50 byte in between?
3) I read that I can copy this data into a wordpad or something and rename it as a Jpeg file to view it. Do you know how I can actually do this? The data that I read from the serial port are display in decimal.
Thank you, any help are much appreciated.
[added by moderator based on PM]
I also experience sycning problem..
When the sync is good, it can sync the whole night but when I power up again in the morning it just won't sync. Once I tried to change the baud rate from 14400 to 115200 and it works for a while.
I have included a reset command to the uCam everytime before I tried to sync it just in case the known bug gives problem.
0xAA 0x08 0x00 0x00 0x00 0xFF
Any suggestions that I can achieve consistency in syncing?
Another question: To save the image from the cam, I have to save all the Jpeg portion of the data to a file? If it is a 50 bype package size, can I start saving the data after the first 4 byte? I understand that the last package might not be 50 byte, how can I determine the last byte of the last package?
Attached files uCam_on_serial.txt (5.6 KB)
I need some help on my Arduino code to retrieve the image data from the uCam ttl and save as a jpeg file.
1) I have managed to retrieve Jpeg format data of package size 50. The image size from the ucam shows 4FO = 1264. The number of packages should be around 25 or 26. How can I write in code to get 1264 out of the hexdecimal 4FO?
2) The received Jpeg data needs to remove the first 4 byte and the next 50 byte would be the Jpeg data. This data is obtained from the serial port, how can I parse the data to read this 50 byte in between?
3) I read that I can copy this data into a wordpad or something and rename it as a Jpeg file to view it. Do you know how I can actually do this? The data that I read from the serial port are display in decimal.
Thank you, any help are much appreciated.
[added by moderator based on PM]
I also experience sycning problem..
When the sync is good, it can sync the whole night but when I power up again in the morning it just won't sync. Once I tried to change the baud rate from 14400 to 115200 and it works for a while.
I have included a reset command to the uCam everytime before I tried to sync it just in case the known bug gives problem.
0xAA 0x08 0x00 0x00 0x00 0xFF
Any suggestions that I can achieve consistency in syncing?
Another question: To save the image from the cam, I have to save all the Jpeg portion of the data to a file? If it is a 50 bype package size, can I start saving the data after the first 4 byte? I understand that the last package might not be 50 byte, how can I determine the last byte of the last package?
Attached files uCam_on_serial.txt (5.6 KB)
Comment