Sending Jpeg Image through LiFi

Hello
I am working on project based on LiFi with one exception that i am using infrared led instead of visible light which is not a big concern.Though I am able to send some string or same alphanumeric data without any difficulty through how my setup and code !! But now i am thinking to do something more with it .
I need some clue that how i can send a jpeg Image through LiFi . And Frankly saying i don't know a thing how to proceed with it please Point me in right direction.
How to send pixel of an image if these pixel information is received and how to reconstruct image from the pixels does it need some application ?

Receiver Code

#include <SoftwareSerial.h>

#define rxPin 2
#define txPin 3

SoftwareSerial XSERIAL =  SoftwareSerial(rxPin, txPin, false);

void setup()  
{
   XSERIAL.begin(9600);

   Serial.begin(9600);

   Serial.println("Start Listening...");
}

void loop() 
{
  if (XSERIAL.available())
  {
      Serial.print((char)XSERIAL.read());
  }
}

Transmitter Code

#include <SoftwareSerial.h>

#define rxPin 3  
#define txPin 4  

SoftwareSerial XSERIAL =  SoftwareSerial(rxPin, txPin);

void setup()  
{
     XSERIAL.begin(9600);
}

void loop() 
{ 
    XSERIAL.println("HELLO");
    delay(1000);  
}

JPEG doesn't have pixels, so yes, you'll need some code to decode the JPEG (Huffman decode, inverse DCT).
A bitmap would be much simpler.

ok you mean i should convert jpeg images into bitmap first . And what about the decoding process what code should i write and how can i send image through transmitter Help me with my code .

ok you mean i should convert jpeg images into bitmap first

I don't believe I said that.
You can send the image in whatever format you like, but send it one byte at a time.

how i send that one byte of data what is to write in code so that one byte of an image transmits .

AWOL:
You can send the image in whatever format you like, but send it one byte at a time.

Mohit:
how i send that one byte of data what is to write in code so that one byte of an image transmits .

mySerial.write() ?

I guess I don't really understand your question.

Where is the image coming from?

How many bytes are there in the image?

What is receiving the data?

...R

Robin2:
mySerial.write() ?

I guess I don't really understand your question.

Where is the image coming from?

How many bytes are there in the image?

What is receiving the data?

...R

You misunderstood me the above code i mentioned is that how much i have done the questions you asked me i don't know because these are my questions too !! how i tell my arduino to pick the image from the location and what should i tell arduino to send in above code i am just writing the string and arduino is transmitting its ascii value but in case of image what should i write in place of that string ?

First you need to study the format of a JPEG image file on your PC. then you can ask intelligent questions about it.

Paul

Paul_KD7HB:
First you need to study the format of a JPEG image file on your PC. then you can ask intelligent questions about it.

Paul

I don't get you what is it to study about its a image file with an extension with a standard specified codec
which defines how an image is compressed into a stream of bytes and decompressed back into an image.
The Exif and JFIF standards define the commonly used formats for interchange of JPEG-compressed images.

So do I need to study these standards too ?

Mohit:
I don't get you what is it to study about its a image file with an extension with a standard specified codec
which defines how an image is compressed into a stream of bytes and decompressed back into an image.
The Exif and JFIF standards define the commonly used formats for interchange of JPEG-compressed images.

So do I need to study these standards too ?

Your first post indicated you were completely clueless about JPEG and pixels, etc. Now you have suddenly become knowledgeable.

Paul

Delta_G:
Was there supposed to be some punctuation in there somewhere? I'm having a hard time reading your last couple of posts. You're not texting your boyfriend here. You're asking pros for free help. You might do well to take some time to make things readable.

What are you trying to imply first of all i am straight (you should be saying girlfriend) and second you are the first one to complain so please others are replying too if they had any problem they should have mentioned it already !!

Paul_KD7HB:
Your first post indicated you were completely clueless about JPEG and pixels, etc. Now you have suddenly become knowledgeable.

Paul

In my first post i meant to say i don't know how i can extract the data from a jpeg and give it to arduino so that arduino can process it and transmit it . I didn't say i don't know about image files.

A file is just a sequence of bytes. The format doesn't (shouldn't) matter to the transmitter or receiver, as long as you know when it starts and ends.

Delta_G:
I took a guess. Your post didn't really imply any specific gender. Don't get your panties in a bunch. Please have a little respect for the folks offering you FREE help. We don't have to do that. If you want to make it harder for them to help you, well that is about the stupidest thing you could do but it's your prerogative.

Why should we care if you don't?

Sir
I really admire and respect the arduino community . but you are the one who made the offensive comment if you focus on helping rather than checking my punctuations and gramatical errors then its not my fault
And I am sorry if i anybody felt bad from that post .

I am working on project based on LiFi with one exception that i am using infrared led instead of visible light

Doesn't that make it IrDA?

Mohit:
You misunderstood me the above code i mentioned is that how much i have done the questions you asked me i don't know because these are my questions too !! how i tell my arduino to pick the image from the location and what should i tell arduino to send in above code i am just writing the string and arduino is transmitting its ascii value but in case of image what should i write in place of that string ?

Let's go back to basics for a moment.

I asked you where the image is coming from and you seem to be saying you don't know - but you are the only person that can know that.

When you say "how i tell my arduino to pick the image from the location" the first thing you need to know is the location. There is no point in worrying about the format of data in a file if you don't know where the file is located.

And I wonder if there isn't a complete mix-up here. Arduinos are not really suitable for dealing with images - they are too slow and they don't have enough memory.

If you answer my questions from Reply #5 we may be able to help you. At the moment we have no idea what your project is all about. And if you can't answer those questions then my guess is that you will not be able to do whatever it is that you want to do.

...R

AWOL:
A file is just a sequence of bytes. The format doesn't (shouldn't) matter to the transmitter or receiver, as long as you know when it starts and ends.

Sir i get it format doesn't matter.But I one thing still i don't get is that for sending string we have alphabets and for numeric data we have number keys and we can write our data according to our need in that Serial.println("") function but what is with image part ? What should i send serially (i get it i have to send a byte at a time but what is this 1 byte data ).

AWOL:
Doesn't that make it IrDA?

Yes you can say but in future i will replace the infrared with led

So, use Serial.write, not Serial.print

Robin2:
Arduinos are not really suitable for dealing with images - they are too slow and they don't have enough memory.

...R

Sir i am thinking to interface a SD CARD Reader with arduino so there i will store my image from where i can access it .

void setup() {
  // Open serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }


  Serial.print("Initializing SD card...");

  if (!SD.begin(4)) {
    Serial.println("initialization failed!");
    return;
  }
  Serial.println("initialization done.");

  if (SD.exists("example.txt")) {
    Serial.println("example.txt exists.");
  } else {
    Serial.println("example.txt doesn't exist.");
  }

  // open a new file and immediately close it:
  Serial.println("Creating example.txt...");
  myFile = SD.open("example.txt", FILE_WRITE);
  myFile.close();

  // Check to see if the file exists:
  if (SD.exists("example.txt")) {
    Serial.println("example.txt exists.");
  } else {
    Serial.println("example.txt doesn't exist.");
  }

  // delete the file:
  Serial.println("Removing example.txt...");
  SD.remove("example.txt");

  if (SD.exists("example.txt")) {
    Serial.println("example.txt exists.");
  } else {
    Serial.println("example.txt doesn't exist.");
  }
}

void loop() {
  // nothing happens after setup finishes.
}

From this i got some idea .Read it just hours ago .

AWOL:
So, use Serial.write, not Serial.print

Okk i will use Serial.write() but what will be the parameters for the function for sending an image.