Giter Site home page Giter Site logo

bridge's Introduction

Bridge Library for Arduino

Check Arduino status Compile Examples status Spell Check status

The Bridge library simplifies communication between the ATmega32U4 and the AR9331.

For more information about this library please visit us at http://www.arduino.cc/en/Reference/YunBridgeLibrary

License

Copyright (c) 2014 Arduino LLC. All right reserved.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

bridge's People

Contributors

aentinger avatar agdl avatar arve0 avatar bitron avatar bobh66 avatar cmaglie avatar facchinm avatar fede85 avatar ffissore avatar hashashin avatar manuel-rabade avatar markfrommst avatar moredread avatar per1234 avatar pnndra avatar robatticus avatar sngl avatar tineler avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bridge's Issues

Compilation errors when Including Bridge.h or Invoking Bridge.begin(): no known conversion for argument 1 from ‘const __FlashStringHelper*’ to ‘const char*’

I tried to run the "Process" example from the Bridge Library. After receiving the SerialUSB not found in this scope error and changing SerialUSB to Serial, I received the following error message:

In file included from /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h:192:0,
                 from /usr/share/arduino/libraries/Bridge/Bridge.h:26,
                 from /usr/share/arduino/libraries/Bridge/BridgeServer.h:22,
                 from /usr/share/arduino/libraries/Bridge/BridgeServer.cpp:19:
/usr/share/arduino/libraries/Bridge/BridgeServer.cpp: In member function ‘virtual void BridgeServer::begin()’:
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:38:95: error: conversion from ‘const __FlashStringHelper*’ to non-scalar type ‘String’ requested
 #define F(string_literal) (reinterpret_cast<const __FlashStringHelper *>(PSTR(string_literal)))
                                                                                               ^
/usr/share/arduino/libraries/Bridge/BridgeServer.cpp:33:20: note: in expansion of macro ‘F’
   String address = F("127.0.0.1");
                    ^
/usr/share/arduino/libraries/Bridge/BridgeServer.cpp:35:13: error: no match for ‘operator=’ (operand types are ‘String’ and ‘const __FlashStringHelper*’)
     address = F("0.0.0.0");
             ^
/usr/share/arduino/libraries/Bridge/BridgeServer.cpp:35:13: note: candidates are:
In file included from /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h:192:0,
                 from /usr/share/arduino/libraries/Bridge/Bridge.h:26,
                 from /usr/share/arduino/libraries/Bridge/BridgeServer.h:22,
                 from /usr/share/arduino/libraries/Bridge/BridgeServer.cpp:19:
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:83:11: note: String& String::operator=(const String&)
  String & operator = (const String &rhs);
           ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:83:11: note:   no known conversion for argument 1 from ‘const __FlashStringHelper*’ to ‘const String&’
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:84:11: note: String& String::operator=(const char*)
  String & operator = (const char *cstr);
           ^
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:84:11: note:   no known conversion for argument 1 from ‘const __FlashStringHelper*’ to ‘const char*’

I don't understand any of this, but I think the F macro is broken.

This happens any time I use the Bridge library, regardless of baud rate specified in Bridge.begin().

In case it's relevant, I'm using an Iduino Yun Shield on a Leonardo R3 and IDE v 2.1.0.5

Problem with request curl, library Bridge.h

Hello, in advance, thanks for your time and help, I also apologize if I use any term not correct; I am a beginner on Arduino subjects. To the problem, I am trying to make a POST request to an api (http: //xxx.xxx.x.xx: xxxx / api / status), in the first request I made to get a token (api / auth), it works correctly. but when it enters the method getStatus apparently the value that has token is blank, print its contents inside the method and has the token that was returned. Through the shell of the plate execute the same curl and everything is executed correctly.

I leave the arduino code so that they can help me.

#include <Bridge.h>
#include <Process.h>
#include <ArduinoJson.h>

/* PROCESS REQUEST */
Process request;
Process terminal;

/* JSON STORAGE */
String jsonToken;
String jsonStatus;

/* AUTH CLIENT */
String token = "";
const String PASSWORD = "USER_PASSWORD;
const String EMAIL = "USER_EMAIL";

/* INFO DEVICE */
const String ID_DEVICE = "MY_ID_DEVICE";

/* STATUS DEVICE */
int pir = 0;
int pro = 0;
int estado = 0;
boolean status_PIR = false;
boolean status_PRO = false;
boolean statusSendData = false;

/* DEVICE CONFIG */
const int PIR_PIN = 6;
const int ECHO_PIN = 11;
const int BUZZER_PIN = 9;
const int TRIGGER_PIN = 12;
const int CALIBRATION_TIME = 10;

/* GENERAL */
long duracion;
long distancia;
String imageName;

/* REQUEST URL´S */
const String URL_POST = "http://xxx.xxx.x.xx: xxxx/api/post";
const String URL_STATUS = "http://xxx.xxx.x.xx: xxxx/api/status";
const String URL_AUTH = "http://xxx.xxx.x.xx: xxxx/api/authenticate";

void setup() {
  Bridge.begin();
  Serial.begin(9600);
  pinMode(PIR_PIN, INPUT);
  pinMode(ECHO_PIN, INPUT);
  pinMode(BUZZER_PIN, OUTPUT);
  pinMode(TRIGGER_PIN, OUTPUT);
  digitalWrite(PIR_PIN, LOW);
  for (int i = 0; i < CALIBRATION_TIME; i++) {
    Serial.println("Calibrando sensor, un momento.");
  }
  Serial.println("Levantando sensor.");
  delay(500);
  Serial.println("Sensor activado correctamente.");
  delay(500);
}

void loop() {
  if (token == "") {
    token = auth(EMAIL, PASSWORD);
  }
  getStatus(ID_DEVICE);
  delay(20000);
}

String auth(String email, String password) {
  StaticJsonBuffer<512> bufferToken;
  request.begin("curl");
  request.addParameter("-k");
  request.addParameter("-X");
  request.addParameter("POST");
  request.addParameter("-F");
  request.addParameter("email=" + email);
  request.addParameter("-F");
  request.addParameter("password=" + password);
  request.addParameter(URL_AUTH);
  request.run();
  while (request.available() > 0) {
    jsonToken = request.readString();
  }
  JsonObject& jsonParsedToken = bufferToken.parseObject(jsonToken);
  String authToken = jsonParsedToken["token"].as<const char*>();
  return authToken;
}

void getStatus(String id_device) {
  DynamicJsonBuffer bufferStatus(512);
  request.begin("curl");
  request.addParameter("-k");
  request.addParameter("-X");
  request.addParameter("POST");
  request.addParameter(URL_STATUS);
  request.addParameter("-H");
  request.addParameter("Authorization: Bearer " + token);
  request.addParameter("-H");
  request.addParameter("Content-Type: application/x-www-form-urlencoded");
  request.addParameter("-d");
  request.addParameter("device=" + id_device);
  request.run();
  while (request.available() > 0) {
    jsonStatus = request.readString();
    Serial.println(jsonStatus); 
  }
  JsonObject& jsonParsedStatus = bufferStatus.parseObject(jsonStatus);
  estado = jsonParsedStatus["status"];
  pir = jsonParsedStatus["pir"].as<int>();
  pro = jsonParsedStatus["pro"].as<int>();
}

I also give you the command curl

curl -X POST http://xxx.xxx.x.xx: xxxx/api/status -H 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjEsImlzcyI6Imh0dHA6Ly8xOTIuMTY4LjEuMzQ6ODA4MC9hcGkvYXV0aGVudGljYXRlIiwiaWF0IjoxNTA4MTI5MDA5LCJleHAiOjE1MDgxMzI2MDksIm5iZiI6MTUwODEyOTAwOSwianRpIjoibXNyVDF5dDVOQ0k3SFBISiJ9.X4UfZ5gR1UZCuuulcgtHqhqIXTZBhV90Wycnx_-po5o' -H 'content-type: application/x-www-form-urlencoded' -d device=5J5J5J5

The above code sends me an {"error": "token_not_provided"}.
Sorry for my English, it's not my native language. thank you for your generous help.

No Serial Monitor output from sketch using Bridge library

Moved from arduino/Arduino#3298 by @IvanKunjasic

I try to upload simple Bridge sketch to my Arduino YUN, but i didn't get any Serial Monitor output.
http://www.arduino.cc/en/Tutorial/Bridge

Also, on two separate Arduino Yuns on two separate laptops, I can't get JsonParserExample(aJSON) to Run. I just get no output in the Serial Monitor. And if I change the lines

if (!root.success()) {
Serial.println("parseObject() failed");
return;
}

to

if (!root.success()) {
Serial.println("parseObject() failed");
return;
} else {
Serial.println("Success!");
}

I still get nothing from the Serial Monitor.

I've checked the Baud Rates. I've run Examples>04.Communication>SerialCallResponse and the Serial Monitor works fine there.

Any clue?

Trouble compiling sketches with Bridge library

When ever I try to compile a sketch which uses the Bridge library I get the following warning(s):
/home/me/Applications/arduino-1.6.5-r5/libraries/Bridge/src/FileIO.cpp: In member function 'uint32_t File::position()':
/home/me/Applications/arduino-1.6.5-r5/libraries/Bridge/src/FileIO.cpp:107:28: warning: left shift count >= width of type [enabled by default]
uint32_t pos = res[1] << 24;
^
/home/me/Applications/arduino-1.6.5-r5/libraries/Bridge/src/FileIO.cpp:108:20: warning: left shift count >= width of type [enabled by default]
pos += res[2] << 16;

I am using the latest Linux version of Arduino. Is this a bug or am I doing something wrong?

FileIO File class lacks default assignment operator

From @davecheney on January 17, 2014 23:56

#include "FileIO.h"

void setup() {
  Bridge.begin();
  FileSystem.begin();

  File f;
  f = FileSystem.open("/tmp/whatever");
}

void loop() {

}

Results in

/Applications/Arduino.app/Contents/Resources/Java/libraries/Bridge/src/FileIO.h: In member function 'File& File::operator=(const File&)':
/Applications/Arduino.app/Contents/Resources/Java/libraries/Bridge/src/FileIO.h:28: error: non-static reference member 'BridgeClass& File::bridge', can't use default assignment operator
sketch_jan18b.ino: In function 'void setup()':
sketch_jan18b.ino:8: note: synthesized method 'File& File::operator=(const File&)' first required here 

This example is taken from a larger example, basically trying to open a File inside a class constructor.

Copied from original issue: arduino/Arduino#1810

async transfer() method

It would be cool to have an async way to work with the bridge library to be able to use it in time sensitive application.
=> Ask for data, do something else, check if data arrived, get data.
=> or send command, return immediately.

My troubles solving the issue

I tried to implement something useful that could be pulled, but stumbled over too many problems. The major one was, that there seems to be a hard-coded 100ms latency in line 175 of Bridge.cpp if I get that right:

for ( ; retries < max_retries; retries++, delay(100), dropAll() /* Delay for retransmission */)

If I avoided that delay, the Bridge.begin() method seemed to have problems (because the 100ms after the execution of transfer() is missing?) and crashed. I might be completely wrong. All pretty unclear to me. Anyway, I run out of time and as transfer() is kind of the core method, had to write a Bridge independent solution (custom .py script sending data over serial).

Adding parameters for retry and delay

Adding more parameters wasn't an issue, but didn't really help, as the transfer() method is called from too many places that would have needed the extra parameters.

Maybe better like that?

It might need adjustable vars in specific libraries (for example the FileIO lib) that would speed up all transfer() calls through that library, while calls (for example through Bridge directly) would use the retry and delay features. Not sure if that's the best way to handle the issue...

YUN: Errors executing Curl or Client.get via Bridge: different behaviors based on length of commands/URL

From @roger77 on March 11, 2014 20:19

I got some strange behavior out of executing curl commands via Arduino to send data via json GET requests. I was also able to replicate the exact problem just by invoking the Client.get() function on a ever increasing URL.
In particular if the total URL length is less than 300 the request executes correctly. Strangely enough, it also execute correctly if the URL length is greater than 500 and less than 800 characters. All URL longer than ~800 will just fails to be executed. Another odd behavior happens when the URL length is between 300 and 500 characters: the request will succeed but its execution time will always take more than 10 sec (see table below). This behavior happens either if I send request to my own server or if I direct the request to echo.jsontest.com.

I simplified the code and it seems length of URL is part of the problem. I tried to follow the forum suggestion and added the '-u' to the python call but it didn't affect the problem.

Here's the link to the forum post and I hope this is a better place to report what I think is a bug:
http://forum.arduino.cc/index.php?topic=222569.msg1626070#msg1626070

Here's the full output: first column is the URL length, second is execution time in ms, last column is amount of free memory in bytes. Execution times greater than 400ms and less than 3 sec usually indicate a successful Client.get() execution. When the execution time is less than 200ms the Client.get() failed to reach the server. I reported only the table up to 1000 chars of command. The program will continue with failed Client.get() until it runs out of memory with a URL of ~1,700 chars.

URL_length Execution_time Free_memory
52 2964 1839
65 908 1826
78 1117 1813
91 1123 1800
104 606 1787
117 1753 1774
130 1129 1761
143 412 1748
156 824 1735
169 527 1722
182 529 1709
195 841 1696
208 435 1683
221 415 1670
234 445 1657
247 530 1644
260 434 1631
273 1795 1618
286 10445 1605
299 10491 1592
312 10493 1579
325 10545 1566
338 10545 1553
351 10595 1540
364 10597 1527
377 10648 1514
390 10653 1501
403 10681 1488
416 10666 1475
429 10737 1462
442 10730 1449
455 10792 1436
468 877 1423
481 8896 1410
494 4455 1397
507 665 1384
520 675 1371
533 799 1358
546 695 1345
559 3095 1332
572 749 1319
585 726 1306
598 738 1293
611 789 1280
624 755 1267
637 767 1254
650 706 1241
663 792 1228
676 796 1215
689 835 1202
702 826 1189
715 834 1176
728 1289 1163
741 847 1150
754 957 1137
767 863 1124
780 864 1111
793 1474 1098
806 1499 1085
819 1474 1072
832 1537 1059
845 150 1046
858 151 1033
871 142 1020
884 140 1007
897 141 994
910 149 981
923 151 968
936 150 955
949 151 942
962 150 929
975 143 916
988 141 903
1001 151 890

Code:
PS: If you don't want to install the MemoryFree library, just comment the associated include and the freeMemory() call.

#include <Bridge.h>
#include <HttpClient.h>
#include <MemoryFree.h>

String url;

HttpClient client;

void setup() {
  pinMode(13, OUTPUT);
  digitalWrite(13, LOW);

  Bridge.begin();
  Serial.begin(9600);

  while(!Serial);
  Serial.println("Starting...");
  url="http://echo.jsontest.com/u?u=1234567890";
}

void loop() {
  url+="&u=1234567890";
  long start=millis();
  client.get(url);
  long delay=millis()-start;
  Serial.print(url.length());
  Serial.print("\t");
  Serial.print(String(delay));
  Serial.print("\t");
  Serial.println(freeMemory());
}

Copied from original issue: arduino/Arduino#1924

Problem opening bmp file with FileIO on the Arduino Yún SD card to image on TFT screen.

From @Lalieu on September 23, 2014 12:49

Hi all,

I have been trying to print a .bmp image on the arduino 1.77" TFT screen using the Arduino Yún, but I have some trouble opening the file using the FileIO library of the Yún. Although I can find the .bmp file on the SD card installed on the Yún, and can open it using: FileSystem.open(filename), it is not loaded as an image file properly when using: PImage logo = tft.loadImage(filename), causing logo.isValid() to return false.

Here is how far I got:

System:

  • Arduino Yún
  • Arduino 1.77" TFT LCD Screen
  • Micro SD card installed to the Yún (using YunDiskSpaceExpander.iso).
  • Image: arduino.bmp stored on the SD card (/mnt/sd/arduino.bmp).

With the system I was able to:

  • Create .txt file on the SD card, read it, and print the text in the file on the TFT screen.
  • Store arduino.bmp file on the SD card and find it in the sketch using
    Code:
    FileSystem.open("/mnt/sd/arduino.bmp")
  • print image on the TFT screen with SD card inserted in the TFT screen (instead of the Yún) and using the Arduino TFT Bitmap Logo example to print the logo on the screen.

So, from this I conclude that the connection between the TFT screen and Yún is fine and the image on the SD card installed in the Yún is accessible using the FileIO library of the Yún.

However, when the .bmp is stored on the SD card in the Yún, the FileIO library is needed to access the file. To display the image, the TFT library is needed, which in turn needs the SD library. The SD and FileIO library interfere with each other, due to double declarations of the File class.
The TFT library just uses the Adafruit_ST7735 and Adafruit_GFX libraries. Looking at these libraries it seems that the SD library is only needed to open the file on the SD card:
bmpFile = SD.open(fileName)
Therefore the PImage class and image handling functions needed to print the image on the screen are only declared when the SD library is loaded (#if defined(SD_H)).

In order to use the Adafruit libraries in combination with the FileIO library instead of the SD library I changed:
bmpFile = SD.open(fileName)
into:
File bmpFile = FileSystem.open(fileName);
and
#if defined(SD_H)
into
#if defined(FILEIO_H)
in the Adafruit library files and Pimage.h file.

With these modifications the different libraries are able to work with each other, and I can access the image on the SD card in the Yún, while using the Adafruit libraries, which should allow to print the image on the screen using the following code:

#include Bridge.h
#include FileIO.h
#include SPI.h
#include "Adafruit_ST7735.h"
#include "Adafruit_GFX.h"

// pin definitions
#define cs   7
#define dc   5
#define rst  6

Adafruit_ST7735 tft = Adafruit_ST7735(cs, dc, rst);

void setup() {

  tft.initG();
  tft.setRotation(1);

  Bridge.begin();
  Serial.begin(9600);

  tft.fillScreen(ST7735_WHITE);
  tft.setTextColor(ST7735_BLACK);  
  tft.setTextSize(1);

  tft.println("Initializing FileSystem...");
  if (!FileSystem.begin()) {
    tft.println("failed!");
    return;
  }
  tft.println("OK!");

  PImage logo = tft.loadImage("/mnt/sda1/arduino.bmp");
  if (!logo.isValid()) {
    tft.println("error while loading Image");
    return;
  }
  tft.println("Image loaded");
_
  delay(5000);

  tft.fillScreen(ST7735_WHITE);
  tft.image(logo, 0, 0);
}

void loop() {
}

However, logo.isValid() returns false. So I guess the image is loaded differently now I’m using:
File bmpFile = FileSystem.open(fileName);
instead of:
bmpFile = SD.open(fileName);
However, until now I haven’t been able to figure out what is going wrong.

Therefore I hope there is someone who knows what is going wrong, or who encountered the problem before and discovered a solution.

Cheers,

Mark

Copied from original issue: arduino/Arduino#2320

Bridge.get("key", buffer, 0) takes forever

If the buffer_length is smaller than the actual content of "key" then the Bridge.get() command takes about >5200 ms (yes, more than 5 seconds ...).

Tested with the following code:

#include <Bridge.h>
#define BUFF_LEN 5

bool once = true;
unsigned long start;
unsigned long end;
char *buffer = new char[BUFF_LEN+1] { '\0' };

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  Bridge.begin(250000);
}

void loop() {
  // put your main code here, to run repeatedly:
  if (once) {
    delay(1000);
    once = false;
    Bridge.put("key", "Test");
    
    start = millis();
    Bridge.get("key", buffer, BUFF_LEN);
    end = millis();
    Serial.println(end - start); **// 6ms**
    
    Bridge.put("key", "TestContent");
    
    start = millis();
    Bridge.get("key", buffer, BUFF_LEN);
    end = millis();
    Serial.println(end - start); **// 5237ms**
    
    Bridge.put("key", "Test");
    
    start = millis();
    Bridge.get("key", buffer, BUFF_LEN);
    end = millis();
    Serial.println(end - start); **// 5237ms**
  }
}

If the buffer_length is bigger than or the exact size of the actual content, it works within ~7ms. Also if the content ONCE is bigger than buffer_length the Bridge.get() will ALLWAYS take >5 seconds, no matter if you reset the content smaller than buffer_length ...

Arduino Yun with Bridge 1.6.3

bridge.cpp should not use String

From @jantje on January 28, 2014 16:27

Currently the bridge library relies on the String class for put command. I think that including String only for put is a bit expensive. The author probably agrees with this as the code has following comment

// TODO: do it in a more efficient way

I think extending transfer to another data set and this (untested) code would be far better

void BridgeClass::put(const char *key, const char *value) {
transfer("D",1,key,strlen(key),"\xFE",1,value,strlen(value));
}
Best regards
Jantje

Copied from original issue: arduino/Arduino#1831

Problem opening bmp file with FileIO on the Arduino Yún SD card to image on TFT screen.

From @Lalieu on September 23, 2014 12:49

Hi all,

I have been trying to print a .bmp image on the arduino 1.77" TFT screen using the Arduino Yún, but I have some trouble opening the file using the FileIO library of the Yún. Although I can find the .bmp file on the SD card installed on the Yún, and can open it using: FileSystem.open(filename), it is not loaded as an image file properly when using: PImage logo = tft.loadImage(filename), causing logo.isValid() to return false.

Here is how far I got:

System:

  • Arduino Yún
  • Arduino 1.77" TFT LCD Screen
  • Micro SD card installed to the Yún (using YunDiskSpaceExpander.iso).
  • Image: arduino.bmp stored on the SD card (/mnt/sd/arduino.bmp).

With the system I was able to:

  • Create .txt file on the SD card, read it, and print the text in the file on the TFT screen.
  • Store arduino.bmp file on the SD card and find it in the sketch using
    Code:
    FileSystem.open("/mnt/sd/arduino.bmp")
  • print image on the TFT screen with SD card inserted in the TFT screen (instead of the Yún) and using the Arduino TFT Bitmap Logo example to print the logo on the screen.

So, from this I conclude that the connection between the TFT screen and Yún is fine and the image on the SD card installed in the Yún is accessible using the FileIO library of the Yún.

However, when the .bmp is stored on the SD card in the Yún, the FileIO library is needed to access the file. To display the image, the TFT library is needed, which in turn needs the SD library. The SD and FileIO library interfere with each other, due to double declarations of the File class.
The TFT library just uses the Adafruit_ST7735 and Adafruit_GFX libraries. Looking at these libraries it seems that the SD library is only needed to open the file on the SD card:
bmpFile = SD.open(fileName)
Therefore the PImage class and image handling functions needed to print the image on the screen are only declared when the SD library is loaded (#if defined(SD_H)).

In order to use the Adafruit libraries in combination with the FileIO library instead of the SD library I changed:
bmpFile = SD.open(fileName)
into:
File bmpFile = FileSystem.open(fileName);
and
#if defined(SD_H)
into
#if defined(FILEIO_H)
in the Adafruit library files and Pimage.h file.

With these modifications the different libraries are able to work with each other, and I can access the image on the SD card in the Yún, while using the Adafruit libraries, which should allow to print the image on the screen using the following code:

#include Bridge.h
#include FileIO.h
#include SPI.h
#include "Adafruit_ST7735.h"
#include "Adafruit_GFX.h"

// pin definitions
#define cs   7
#define dc   5
#define rst  6

Adafruit_ST7735 tft = Adafruit_ST7735(cs, dc, rst);

void setup() {

  tft.initG();
  tft.setRotation(1);

  Bridge.begin();
  Serial.begin(9600);

  tft.fillScreen(ST7735_WHITE);
  tft.setTextColor(ST7735_BLACK);  
  tft.setTextSize(1);

  tft.println("Initializing FileSystem...");
  if (!FileSystem.begin()) {
    tft.println("failed!");
    return;
  }
  tft.println("OK!");

  PImage logo = tft.loadImage("/mnt/sda1/arduino.bmp");
  if (!logo.isValid()) {
    tft.println("error while loading Image");
    return;
  }
  tft.println("Image loaded");
_
  delay(5000);

  tft.fillScreen(ST7735_WHITE);
  tft.image(logo, 0, 0);
}

void loop() {
}

However, logo.isValid() returns false. So I guess the image is loaded differently now I’m using:
File bmpFile = FileSystem.open(fileName);
instead of:
bmpFile = SD.open(fileName);
However, until now I haven’t been able to figure out what is going wrong.

Therefore I hope there is someone who knows what is going wrong, or who encountered the problem before and discovered a solution.

Cheers,

Mark

Copied from original issue: arduino/Arduino#2320

compile error

When i use #include <ModbusMaster.h> from ModbusMaster v2.0.1 sctach does not compile

#include <Bridge.h>
#include <BridgeServer.h>
#include <BridgeClient.h>
#include <ModbusMaster.h>

i got this error:
C:\Program Files (x86)\Arduino\libraries\Bridge\src\Bridge.cpp: In member function 'void BridgeClass::crcUpdate(uint8_t)':

C:\Program Files (x86)\Arduino\libraries\Bridge\src\Bridge.cpp:121:33: error: '_crc_ccitt_update' was not declared in this scope

CRC = _crc_ccitt_update(CRC, c);

i appreciate any sloution

Strange serial behavior

Because of higher demands in our project we tend to leave the yun / openwrt boards an make a shift to to stronger chips etc etc.

The uart communication is working flawless, when connecting to the uart pin, al full working console without any strange chars.

But...

When we try with the bridge library, through the uart pins, we see the communication, but the run-bridge is never executed. The arduino lib is wrapping arount ru some extra stuff.

Dont look at the path, it are just guesses of the env var. Completely normal. I will mark the behavior with bold.

stat64("/usr/bin/\371run-bridge", 0xbed7a840) = -1 ENOENT (No such file or directory)
stat64("/sbin/\371run-bridge", 0xbed7a840) = -1 ENOENT (No such file or directory)
stat64("/bin/\371run-bridge", 0xbed7a840) = -1 ENOENT (No such file or directory)

read(0, "r", 1) = 1
write(2, "\371", 1) = 1
read(0, "u", 1) = 1
write(2, "ru", 2) = 2

read(0, "n", 1) = 1
write(2, "n", 1) = 1
read(0, "b", 1) = 1
write(2, "b", 1) = 1
read(0, "r", 1) = 1
write(2, "r", 1) = 1

Some how the class is moving ru as one. instead of 1 by 1.

It could be that openwrt uses an more simpler term ?

Any idea's or help would be helpfull!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.