These are chat archives for SmingHub/Sming

4th
Nov 2015
alonewolfx2
@alonewolfx2
Nov 04 2015 05:31
@hreintke telnet command processing is a little weird. First command always can't recognize when connect telnet. Second command is fine. For example if I need led open I am using "led on" command but I am getting command not recognized and I am sending second "led on" and it's recognized.
I tried putty on Windows
Socket client on Android
alon24
@alon24
Nov 04 2015 06:36
@hreintke the thing is that this is implemented in eboot, igrrrs custom boot, so it there every time with mdns, so it's always waiting always on, does not need any extra work, it also appears on arduino ide, as network device, its quite nice by what I've seen
and we know that rboot has very very good Ota, so can listening on ports be integrated to rboot, and functionality like that, I am not saying copy, but integrate it, only suggestion...
alon24
@alon24
Nov 04 2015 06:56
another thing here is that this is Ota via tcp send and not http Get, so u do not need to host the file on an http server, just send from the ide
hreintke
@hreintke
Nov 04 2015 07:31
@alonewolfx2 : Which telnet client are you using ? I know some of them, when started, begin with "communication about connection" like echo on/off etc. The Telnet Server doesn't handle that communication, sending that info to the CommandProcessor -> first command gives "unknwon command"
@alon24 : It is not the boot process but part of the application. Boot process cannot handle wifi/network.
And yes, I am also thinking of implementing something like that as rBoot class so 1/ not everyone has to invent it and 2/ would give an ESP which can be handled/supported completely remote. As I said, with some limitations.
alon24
@alon24
Nov 04 2015 07:44
@hreintke thats a good idea I am rooting for u!
alon24
@alon24
Nov 04 2015 08:05
can anyone remind me where to download the esp-open sdk 1.4 for mac
?
Dmitry Kireev
@kireevco
Nov 04 2015 08:32
:D
Dmitry Kireev
@kireevco
Nov 04 2015 08:42
@alon24 ^
alon24
@alon24
Nov 04 2015 08:44
@kireevco is the link in the wiki ( mac os howto)? I do not think i saw it
Dmitry Kireev
@kireevco
Nov 04 2015 08:44
I don’t htink we’re ready for 1.4.0 yet
next release we’ll add it
alon24
@alon24
Nov 04 2015 08:47
but 1.3 is not there either (and it works ok on mac for me)
Dmitry Kireev
@kireevco
Nov 04 2015 08:48
done
1.3 for now
alon24
@alon24
Nov 04 2015 08:52
@tprochazka I realy do not understand how gpio9 works for you, I just tried blink with latest dev (sming) and sdk 1.4 (opensdk on mac), and I get reset for gpio9, and ok for gpio10 - dio ofcourse
/opt/esp-open-sdk-1.4.0/esptool/esptool.py -p /dev/tty.SLAB_USBtoUART -b 961000 write_flash -ff 40m -fm dio -fs 4m 0x00000 out/firmware/0x00000.bin 0x09000 out/firmware/0x09000.bin 0x38000 out/firmware/spiff_rom.bin
#include <user_config.h>
#include <SmingCore/SmingCore.h>

#define LED_PIN 9

Timer procTimer;
bool state = true;

void blink()
{
    digitalWrite(LED_PIN, state);
    state = !state;
    debugf("blink!");
}

void init()
{
    pinMode(LED_PIN, OUTPUT);
    procTimer.initializeMs(1000, blink).start();
}
Dmitry Kireev
@kireevco
Nov 04 2015 08:56
@alon24 thank you :)))
alon24
@alon24
Nov 04 2015 08:56
:)
Dmitry Kireev
@kireevco
Nov 04 2015 08:56
I love how gitter turns includes into headers
lol
Murli Shenoy
@hmms
Nov 04 2015 09:09
i was trying to read the HTU21DF using the Adafruit library (https://github.com/adafruit/Adafruit_HTU21DF_Library) the 'begin' function works and the chip is detected, but the data requested using the Wire.requestFrom() doesnt seem to work and returns zero bytes, also Wire.Available() does'nt seem to work and returns zero. are there any work arounds? I would be glad to contribute to help solve this issue, pointers appreciated! :)
Dmitry Kireev
@kireevco
Nov 04 2015 09:10
@hmms hi, is this related to I2C ?
I mean is HTU21DF working via I2C?
Murli Shenoy
@hmms
Nov 04 2015 09:11
nope
i tested the chip itself via an arduino UNO
and that seems to work
Dmitry Kireev
@kireevco
Nov 04 2015 09:12
Please create a new issue, and remove it from #194
Murli Shenoy
@hmms
Nov 04 2015 09:12
ok will do.
Dmitry Kireev
@kireevco
Nov 04 2015 09:12
:) Thank you
Murli Shenoy
@hmms
Nov 04 2015 09:17
done
Dmitry Kireev
@kireevco
Nov 04 2015 09:17
cool, thank you
Murli Shenoy
@hmms
Nov 04 2015 09:17
:)
any pointers on why the Wire.requestform would be requesting zero?
Dmitry Kireev
@kireevco
Nov 04 2015 09:18
sorry, I don’t know. maybe @raburton or @hreintke could help?
Murli Shenoy
@hmms
Nov 04 2015 09:19
ok, in the mean time I'll dig into the sming wire implementation
Dmitry Kireev
@kireevco
Nov 04 2015 12:15
Updated mac quickstart @alon24 and everyone who is using mac please review and comment https://github.com/SmingHub/Sming/wiki/MacOS-Quickstart
alon24
@alon24
Nov 04 2015 12:18
I would change the stuff about installing in opt
Install prebuilt ESP Open SDK
Get Sming Core:

Because El-Captian does NOT allow you to do this:
cd /opt/
sudo git clone https://github.com/SmingHub/Sming.git

I would suggets install to user friendly places
I would add also a picture in eclipse of glabal params (environment) for the 
Configure Environment Variables section (sometime, this step does not work)
after : Or build it yourself - I would add a menaical laugh( just kidding,but its close to impossible, so thanks for building for us)
alon24
@alon24
Nov 04 2015 12:23
btw can anyone replicate usage of GPIO9 when using dio for OUTPUT - I tried on 2 computers, with 2 operating systems, and all manner of sdks and no luck
Dmitry Kireev
@kireevco
Nov 04 2015 13:03

after : Or build it yourself - I would add a menaical laugh( just kidding,but its close to impossible, so thanks for building for us)

lol

@alon24 really, it doesn’t let you cd, and then sudo git clone ?
I don’t have any issues right now
user friendly places is ok, but it kills unification.
… We should create a homebrew package… hmmmmmmmmmmm
brew install sming
alon24
@alon24
Nov 04 2015 13:08
In ElCapitan they added the new security that does NOT allow you to put stuff there in /opt - its called rootless
System Integrity Protection, or Rootless
cameoDT
@cameoDT
Nov 04 2015 13:45
@alon24 @raburton @kireevco @hreintke @robotiko Hi, Can ESP be used in production environment? What implementation care needs to be taken? Will these be functional for two years?
hreintke
@hreintke
Nov 04 2015 13:45
@kireevco : Can we have one wiki page which can be updated by all (not only Sminghub members) ?
alon24
@alon24
Nov 04 2015 13:51
@cameoDT I do not know about legal stuff
I do not have anytthing realy working yet :)
cameoDT
@cameoDT
Nov 04 2015 13:56
@alon24 But are these reliable enough to get into market as a saleable product?
Can I make a consumer product out of ESP and Sming and sell it to consuemr?
alon24
@alon24
Nov 04 2015 13:57
try it and tell me! :)
sming consumer product is LEGAL and so I do not know
cameoDT
@cameoDT
Nov 04 2015 13:57
What could go wrong?!
Llegalties apart
alon24
@alon24
Nov 04 2015 13:58
there are products based on it
cameoDT
@cameoDT
Nov 04 2015 13:58
Direct Question ->Can esp host accesspoint for two years ?
continiously
what could go wrong from hardware perspective?
Things I should take care of
alon24
@alon24
Nov 04 2015 14:01
u need a stable power supply, put capacitors to handle peaks of about 300ma
cameoDT
@cameoDT
Nov 04 2015 14:02
yeah. What else?
mositure ,temperature?
alon24
@alon24
Nov 04 2015 14:02
test in a heavy rf signal area, like a workspce with many wifi networks - to make sure it can handle it
cameoDT
@cameoDT
Nov 04 2015 14:03
what if it doesnt ? what can be done to rectify
to make it handle
in heavy rf environment
alon24
@alon24
Nov 04 2015 14:04
maybe add an external antenna
i do not know
cameoDT
@cameoDT
Nov 04 2015 14:04
Can you suggest some reading material/refernece/guidelines for hardware design requiremtns
What do others have to say
Sven Eliasson
@comino
Nov 04 2015 14:05
@cameoDT : Where are u located and where do you want to sell it?
alon24
@alon24
Nov 04 2015 14:05
i am not equipped for that, i am a programmer
Sven Eliasson
@comino
Nov 04 2015 14:06
@cameoDT : Getting the hardware design requirements is like 50% of the job and is different for any applicaiton.
cameoDT
@cameoDT
Nov 04 2015 14:07
I am a freelancer. Designing for someone else
@comino what else needs to be taken care of. Can you please elaborate
Sven Eliasson
@comino
Nov 04 2015 14:08
@cameoDT Depends on the application and use cases. Dont know both :/.
cameoDT
@cameoDT
Nov 04 2015 14:08
I need to make a remote kind of thing with screen and touch buttons
kind of universal remote
Sven Eliasson
@comino
Nov 04 2015 14:12
General advice:
1) Write down all the stuff the system can do and all the use cases (what the user can do with it).
2) Try to come up with a rough system structure (and maybe devide into smaller groups)
3) Think about what can go wrong and what you can do about it
4) Build it an be happy
General issues: EMC, Security ;)
But maybe here is not the best chat for that kind of discussion since its not a Sming specific problem ;)
alon24
@alon24
Nov 04 2015 14:14
touch screen will take many gpios unless its like the new nextion
why do u use?
cameoDT
@cameoDT
Nov 04 2015 14:14
@comino Can you suggest some reading material/refernece/guidelines for hardware design requiremtns
Sven Eliasson
@comino
Nov 04 2015 14:15
only : https://spacecomponents.org/ ... but its for space stuff :D maybe a little overkill
As said - there will be better stuff out there - but have nothing in mind currently
cameoDT
@cameoDT
Nov 04 2015 14:17
I meant capacitive touch buttons
whewe do i get a olen panel of larger size for this kind of controler
hreintke
@hreintke
Nov 04 2015 14:17
@comino : Of course no problem asking questions here but be aware :
This is a chat about Sming Framework and the implementation of that.
Your questions look like generic ESP8266/Hardware/Design questions -> Probably there are better places to ask.
Sven Eliasson
@comino
Nov 04 2015 14:18
why @comino ? :P
cameoDT
@cameoDT
Nov 04 2015 14:18
@hreintke got it
alon24
@alon24
Nov 04 2015 14:22
@cameoDT final thought look here: http://tech.scargill.net/
Dmitry Kireev
@kireevco
Nov 04 2015 14:54
@hreintke one can send a PR agains wiki
@cameoDT I don’t think so.
(answering your questions)
hreintke
@hreintke
Nov 04 2015 15:08
@kireevco : But I would like "non committers" work together on a page which shows a "How to/What to do when upgrading"
"Just updating a page" is a much more user-friendly way of doing that the asking to submit a PR.
If not "open for all" can there be a list of users which are allowed to update ?
Dmitry Kireev
@kireevco
Nov 04 2015 15:10
@hreintke I think it is editable right now
Dmitry Kireev
@kireevco
Nov 04 2015 15:43
@hreintke All feathre, hotfix branches,right?
hreintke
@hreintke
Nov 04 2015 16:13
@kireevco : yes please
Dmitry Kireev
@kireevco
Nov 04 2015 16:17
k
@hreintke done
evanmj
@evanmj
Nov 04 2015 16:23
Hi, does anyone have example or test code for SPI.cpp? I'm new to c++, and I'm trying to figure out how to bidirectionally communicate with an arduino as a slave. It looks like the writeData and readData methods are used by the transfer method... Do I simply pass a pointer to the transfer method? Is a uint8_t proper size for a pointer on the ESP? Since the return type of transferData is byte, am I limited to 1 byte at a time using the transfer method? This seems strange since readData and writeData seem to support an arbitrary number of bytes... yet readData has no return value? Can anyone spare some help or point me in the right direction for more resources?
evanmj
@evanmj
Nov 04 2015 17:39
I think I have an idea of what it is doing now
Sven Eliasson
@comino
Nov 04 2015 17:44
I have an issue with BMP180 code - It somehow only return zeros. Can someone confirm I2C IS working with the lastest version?
evanmj
@evanmj
Nov 04 2015 17:44
If someone could confirm or deny this it would help: User sets 'data' to what they want to send. Then calls SPI.transfer with a pointer to 'data', data is sent to SPI register 0 (SPI_FLASH_C0) and then sent out on the wire. Data returned into the register is then brought in to the 'data' memory address with a readData. So, after the call to SPI.transfer(&data), the data is sent, then a response is contained in the 'data' memory space. Am I on the right track?
alonewolfx2
@alonewolfx2
Nov 04 2015 18:01
@comino I am using bmp180 but not latest code. I will try lastest and let you know
Sven Eliasson
@comino
Nov 04 2015 18:03
@alonewolfx2 thx :)
alonewolfx2
@alonewolfx2
Nov 04 2015 18:04
@comino what are you building
Sven Eliasson
@comino
Nov 04 2015 19:08
@alonewolfx2 Im building a multi-sensor board as some kind of Wifi data logger. And I used to work with Arduino where it was working well. But I feel more comfortable with native enviroments ;)
alonewolfx2
@alonewolfx2
Nov 04 2015 19:23
right. which sensors you are using
Sven Eliasson
@comino
Nov 04 2015 19:26
Temp + press BMP180, T+Humid HTS221, Air quality MP503+I2C ADC, Light sensor APDS-9309, higher precision temp ADT7410. But only BMP is currently mounted ;)
oh and I2S microphone footprint is on the board. But havent tested it yet
alonewolfx2
@alonewolfx2
Nov 04 2015 19:30
is it comerical or can you share it
open-home-automation
@open-home-automation
Nov 04 2015 19:31
Probably a stupid question but... To enumerate the wifi networks one can use WifiStation.startScan(networkScanCompleted). But is there also a possibility to provide a class member function there?
Sven Eliasson
@comino
Nov 04 2015 19:32
We try to make it commercial, but will also be open source as it hits market. ;)
And I realy like Sming - I hope I will get the chance to contribute ;)
alonewolfx2
@alonewolfx2
Nov 04 2015 19:36
i need airquality sensor on esp8266 too
Sven Eliasson
@comino
Nov 04 2015 19:38
The MP503 is working quite good out of the box. You can actually get it from seedstudio : http://www.seeedstudio.com/wiki/Grove_-_Air_Quality_Sensor_v1.3
open-home-automation
@open-home-automation
Nov 04 2015 19:39
Please anybody?
Sven Eliasson
@comino
Nov 04 2015 19:49
@open-home-automation : I assume you tried and its not working? ;)
Sven Eliasson
@comino
Nov 04 2015 20:01
@open-home-automation : you also have issues with the Sming I2C driver?
Murli Shenoy
@hmms
Nov 04 2015 20:11
@comino
Sven Eliasson
@comino
Nov 04 2015 20:15
just saw it in the repo that its workign for flexiti - will check whats wrong with mine.. have the latest version + arduino code is working.
Murli Shenoy
@hmms
Nov 04 2015 20:21
I will test it tonight and confirm
open-home-automation
@open-home-automation
Nov 04 2015 20:48
@comino when I specify a function defined in a class it won't compile
I am trying to figure out what the delegate magic does
Murli Shenoy
@hmms
Nov 04 2015 20:50
@open-home-automation are you using your own library? have you tried recompiling the smingcore?
open-home-automation
@open-home-automation
Nov 04 2015 20:51
I indeed had problems with I2C. I am using another I2C driver now but I woud rather likt to use the Sming one
@hmms why recompile smingcore? I just want to use the api as is and provide a class member function as parameter to it, preferably without changing anything to Sming
Murli Shenoy
@hmms
Nov 04 2015 20:53
Ohh ok I thought you are using a custom external library not included with sming!
open-home-automation
@open-home-automation
Nov 04 2015 20:56
I have written a lot of code in C and now I would like to bundle everything in a class in C++
but then in some cases I need to specify a class member function as callback so that the function for a specific object is called
robotiko
@robotiko
Nov 04 2015 20:58
@open-home-automation have a look at delegate
works great
open-home-automation
@open-home-automation
Nov 04 2015 21:01
@robotiko I looked into it but for someone who is not used to c++ there is probably a bit too little documentation...
robotiko
@robotiko
Nov 04 2015 21:02
it is very simple.. just look at an example and you will get it very fast
is like a callback
open-home-automation
@open-home-automation
Nov 04 2015 21:09
typedef Delegate<void(bool, BssList)> ScanCompletedDelegate;
How do I get from this one to a member function of an object? Or is it the idea to add an extra parameter to it being the object of which I want to call a member function?
robotiko
@robotiko
Nov 04 2015 21:10
from what example you got that?
config_network?
open-home-automation
@open-home-automation
Nov 04 2015 21:11
Station.h class StationClass
robotiko
@robotiko
Nov 04 2015 21:12
ok
I will guide you in a personal example
I have servo class
with a delegate that will be called when motor completed movement
1) you define the delegate type
typedef Delegate<void()> ServoDelegate;
2) in my servo class I define a method to define externally the delegate function
class Servo
{
public:
void onCompleted(ServoDelegate handler);
and protect the variable that will hold the delegate function
private:
ServoDelegate servoCompleted;
@open-home-automation still there?
open-home-automation
@open-home-automation
Nov 04 2015 21:17
yes
robotiko
@robotiko
Nov 04 2015 21:17
ok
void Servo::onCompleted(ServoDelegate handler)
{
servoCompleted= handler;
}
that fills it
open-home-automation
@open-home-automation
Nov 04 2015 21:18
ok
but then you call a void function
so imagine you have something like
class ServoController
{
void HandleServoMovementComplete() { //whatever }
}
How do you link that to your delegate?
robotiko
@robotiko
Nov 04 2015 21:21
ok .. at this point in the servo class you have a delgate ready to be called when needed
so in the method that computes movement.. when it detects that the movement is completed.. you have to call the delegate
and your question..
open-home-automation
@open-home-automation
Nov 04 2015 21:23
correct, that is basically the way callbacks in C work, only the syntax is different right?
robotiko
@robotiko
Nov 04 2015 21:23
to externally define the delgation
yes .. is like call back
callback
then need to take care of the external definition of the delegate
open-home-automation
@open-home-automation
Nov 04 2015 21:25
and that external definition is where I am lost...
robotiko
@robotiko
Nov 04 2015 21:26
thats is basically a cast to the delegate class
car.onMoveCompleted(ServoDelegate (&MyClass::motorMoveCompleted,this));
that would call the car class method motorMoveCompleted
when the servo is done
open-home-automation
@open-home-automation
Nov 04 2015 21:27
wow! that is exactly what I was looking for!
robotiko
@robotiko
Nov 04 2015 21:28
basically the delegate allows to encapsulate nicely the callback
so you can call a method
or a class method to link the object events
but in concept is a callback
clean one in OOP
open-home-automation
@open-home-automation
Nov 04 2015 21:29
indeed very clean
robotiko
@robotiko
Nov 04 2015 21:29
yup .. nice one
:D
@hreintke usually defends that pattern and cleans all dirty callbacks with delegated
open-home-automation
@open-home-automation
Nov 04 2015 21:32
I am constantly programming in C and it has been a very long time ago that I was playing around with C++
Seems like I have some catching up to do
robotiko
@robotiko
Nov 04 2015 21:32
C++ OOP or Java OOP?
is quite different ..
be warned :)
open-home-automation
@open-home-automation
Nov 04 2015 21:33
me no like java :-)
open-home-automation
@open-home-automation
Nov 04 2015 21:39
At work we use good old C as it clearly compiles into faster executing code
But on the ESP that probably isn't even measurable
Anyway thanks @robotiko for the explanation!
robotiko
@robotiko
Nov 04 2015 22:15
@open-home-automation c might be slightly faster.. but not much if any
however in large projects.. it is worthy.. in bugs .. and code maintenance