Comments (12)
IPAddress.h
overloads various operators so it can be used in place of uint8_t *
.
Have a look at hardware/arduino/sam/cores/arduino/IPAddress.h
in the arduino install.
I have no idea why this does not work on Galileo. Does it use a modified version of the standard libraries? You mention removing the reference to pgm_read_byte_near
- again, a standard part of the arduino environment - which makes me think the Galileo must be using something different, and incompatible.
from pubsubclient.
On of most important things of Galileo is that all Arduino libraries are compatible with it.
However, it is written on all Galileo documentation....but it seems to be not completely true. :-)
Obviously, pgm_read_byte_near came from AVR and on Galileo there isn't an AVR but an Intel Quark based on x86.
from pubsubclient.
You can see here how I #define
a replacement pgm_read_byte_near
in order to build this library on i686 for the unit tests. You might be able to do similar in your sketch without modifying the core library.
I don't have a galileo board, so there isn't anything I can do with this issue.
from pubsubclient.
Ok ... Thanks Nick I will update you with news from Intel...
from pubsubclient.
Hi Nick...why did you define pgm_read_byte_near in a header file outside the lib but inside the tests folder ?
The same thing for IPAddress.h where you defined IPAddress as uint8_t*.
Is the righe place inside the library ?
from pubsubclient.
pgm_read_byte_near
is a standard function in the arduino environment - as is IPAddress
.
The proper definitions for those are provided by the Arduino IDE.
The code in the tests folder is standalone code that I can compile and run on my laptop to test the library. To be able to do this, I had to create stub versions of the standard arduino code that the library depends on - this is what you can see in tests/lib
.
For example, pgm_read_byte_near
, as you have previously said, is an AVR specific function to read from PROGMEM. In order to test my library correctly calls that function, I have provided an alternative version in my stub version of Arduino.h
.
Similarly, my library doesn't explicitly use any of the advanced features of the arduino implementation of IPAddress
- for my tests it is sufficient just to #define
it as uint8_t*
.
from pubsubclient.
Ok....but....
Arduino.h distribuited with Intel Galileo IDE isn't different from the original and the pgm_read_byte_near isn't defined inside it. I have to redefine it inside a new header file different from Arduino.h and include it inside you library.
Other problem I posted on the Intel community forum...
Your methods use ip addresses as byte array so you have defined IPAddress as uint8_t* to avoid to change your library. On Galileo, It seems that the methods in the EthernetClient class work only with instance of IPAddress class and not with bytes array....so for now I have to change your library to accept IPAddress class instance.
from pubsubclient.
The code under tests
is not intended to be used on a functional platform. It is purely for unit testing the functionality of the client. Where I have put particular definitions is only of interest to anyone writing additional tests.
Do you know if there is a #define that can be used to detect the library is being compiled for Galileo? If there is, you could add whatever additional #defines are needed inside #ifdef
blocks in PubSubClient.h
from pubsubclient.
I will investigate on it...
from pubsubclient.
I've managed to get it to compile by following this https://communities.intel.com/thread/46076 and adding #include <avr/pgmspace.h> to PubSubClient.cpp - however I've had no luck getting it to connect
from pubsubclient.
Same problem as @thisisthechris on edison board. No errors during building. I guess the problem is while connecting..
@thisisthechris did you manage to come over it?
from pubsubclient.
Spent today figuring some of this out having got my hands on a Galileo (finally! I hear you all cry).
I can't explain why passing the broker IP address as byte* fails, but was able to reproduce. I've now added functions that accept IPAddress and will update the docs to 'prefer' them as they work everywhere.
I've also put ifdefs around the progmem stuff - so it gets excluded when progmem isn't defined. That all works, but a bit more work needed to get that to work on the esp8266.
Expect a new release of the library this week.
from pubsubclient.
Related Issues (20)
- Reconnects every 4 hours HOT 2
- Sometimes payload are mixed up with topic. HOT 1
- Callback is not called when i am pubishing audio data in bytes.
- Intermittent delay of minutes between ESP publish and receipt by mosquitto in a pi HOT 1
- Anomolous performing when using along with I2S
- Issue while setting keep alive zero. HOT 2
- Bug in PubSubClient::connected HOT 1
- Retain Flag not working HOT 1
- receiving arbitrarily large messages HOT 1
- Use hostname for the MQTT broker IP HOT 2
- Library when subscribing to third topic won't connect to ethernet
- Connecting and running smoothly on mobile hotspot while rc=-2 on fiber broadband wifi router
- Future of this module HOT 7
- Reconnect Problem. HOT 11
- Different error on Ubuntu arduino ide from windows arduino ide.
- #error "This library only supports boards with an AVR, SAM, SAMD, NRF52 or STM32F4 processor." HOT 1
- Client.connected() does not return false if MQTT Broker Pc disconnects from Internet or local network. HOT 1
- Can't Connect to mqtt broker after including SPI.h
- When callback is registered to topic that contains underscore, the underscore is replaced with space HOT 1
- pubsub library not thread safe.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pubsubclient.