Go Down

Topic: Real-time bus information (Read 606 times) previous topic - next topic

thmmax

Hey guys,

i'm working on a real-time information about bus departures.
I use an Arduino with Ethernet Shield and 4 led matrices.

Displaying the text works - as you can see in the attachment (The first letter on the left side is the bus line, the next is the direction and the last is departure time).
The code looks like this:
Code: [Select]

#include "HT1632.h"

#define DATA 2
#define WR   3
#define CS   4
#define CS2  5
#define CS3  6
#define CS4  7

HT1632LEDMatrix matrix = HT1632LEDMatrix(DATA, WR, CS, CS2, CS3, CS4);

void setup() {
  Serial.begin(9600);
  matrix.begin(HT1632_COMMON_16NMOS);
  delay(0);

}

void loop() {
  matrix.clearScreen();
  matrix.setTextSize(1);   
  matrix.setTextColor(1);

  if (matrix.width() <= 24) {
    matrix.setCursor(0, 0);
    matrix.print("");
    matrix.setCursor(0, 8);
    matrix.print("");
    matrix.writeScreen();
  } else if (matrix.width() > 24) {
    matrix.setCursor(0, 0);   // First left
    matrix.print("D  K");
    matrix.setCursor(0, 8);   // Second left
    matrix.print("E  F");
    matrix.setCursor(48, 0);  // Third left
    matrix.print("DE K");
    matrix.setCursor(48, 8);  // Fourth left
    matrix.print("DE H");
    matrix.setCursor(24, 0);  // First right
    matrix.print("  7'");
    matrix.setCursor(24, 8);  // Second right
    matrix.print("  9'");
    matrix.setCursor(72, 0);  // Third right
    matrix.print("1749");
    matrix.setCursor(72, 8);  // Fourth right
    matrix.print("1820");
    matrix.writeScreen();
}
 
  delay(1000000);

}


To get the real-time, I want to use the source-code of my transport authority, it displays 4 departures and all the information you need:
http://www.ivb.at/smartinfo/ivb_smartinfo_kernel.php?olifServerId=84&autorefresh=20&default_autorefresh=20&routeId=&stopId=Absam%20Dorf&optDir=-1&nRows=4&showArrivals=n&optTime=now&time=&allLines=y&app=sionline

There is no API available. Has anyone an idea how to load the information from the source code to my led matrices?
I've looked up some tutorials, but no one really solved this problem..

Thanks for your help!
Max

PaulS

Quote
There is no API available

How did you get all the right arguments, then?

Do you have an Ethernet shield? Have you made a GET request that contains the same script and arguments, or the same server? Did you get a reply?

thmmax

Thanks for your answer!
All the departures are just random - at this moment, there is no connection to the server!

I have an Ethernet shield - the problem is, how to programm the Arduino to copy the data from the server into the script...

thmmax

I solved the problem now - I just added the 'host'  :)

Go Up