Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Feb 12 2020 12:42
    Build #213 passed
  • Feb 12 2020 12:40
    greenkeeper[bot] commented #110
  • Feb 12 2020 12:40

    greenkeeper[bot] on gulp-shell-0.8.0

    chore(package): update gulp-she… (compare)

  • Dec 20 2019 22:51
    Build #212 passed
  • Dec 20 2019 22:49
    greenkeeper[bot] commented #109
  • Dec 20 2019 22:49

    greenkeeper[bot] on eslint-6.8.0

    chore(package): update eslint t… (compare)

  • Nov 30 2019 19:04
    Build #211 passed
  • Nov 30 2019 19:03
    greenkeeper[bot] commented #109
  • Nov 30 2019 19:02

    greenkeeper[bot] on eslint-6.7.2

    chore(package): update eslint t… (compare)

  • Nov 25 2019 05:13
    Build #210 passed
  • Nov 25 2019 05:11
    greenkeeper[bot] commented #109
  • Nov 25 2019 05:11

    greenkeeper[bot] on eslint-6.7.1

    chore(package): update eslint t… (compare)

  • Nov 22 2019 20:37
    Build #209 passed
  • Nov 22 2019 20:33
    greenkeeper[bot] commented #109
  • Nov 22 2019 20:33

    greenkeeper[bot] on eslint-6.7.0

    chore(package): update eslint t… (compare)

  • Oct 25 2019 20:49
    Build #208 passed
  • Oct 25 2019 20:48
    greenkeeper[bot] commented #109
  • Oct 25 2019 20:47

    greenkeeper[bot] on eslint-6.6.0

    chore(package): update eslint t… (compare)

  • Oct 21 2019 23:38

    alexdresko on master

    unofficial hs3 Merge branch 'master' of https:… (compare)

  • Oct 21 2019 23:31

    alexdresko on master

    Update README.md (compare)

Alex Khassapov
@alexbk66
It's not difficult, you just need to use API properly
HomeSeerAPI.WebPageDesc wpd = new WebPageDesc
{
    plugInName = PluginName,
    link = link,
    linktext = linktext,
    page_title = page_title
};

// Link for "Manage Plugins" page
Callback.RegisterConfigLink(wpd);
// Link for Plugins Menu
wpd.plugInName = PluginNameCleaned;
Callback.RegisterLink(wpd);
Odd Erik Midthaug
@oesolberg
Have any of you gotten PluginFunction to work with arrays of classes? I can get it to work with array of string, but when I try to return a serializable class in an array the calling script gives me an exception (Object reference not set to an instance of an object)
Alex Khassapov
@alexbk66
PluginFunction is designed to return result of function executed inside plugin. You can't return objects allocated inside pluging executable - they belong to plugin memory space.
Odd Erik Midthaug
@oesolberg
I have managed to return an array of strings from my plugin. And I see that BLGData plugin returns an array of CalendarEvents. So it can be done. I am just not sure how.
Alex Khassapov
@alexbk66
Probably strings are native and HS knows how to marshal them.. I'm not sure what BLGData returns, possible also array of strings? Do you realise that plugin is an executable, when you create an object - it allocates it in its own memory - you can't expect to access process memory outside the process space. It's not as trivial, https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-dcom/d325327c-4b2c-4096-964e-c596feffd929
Odd Erik Midthaug
@oesolberg
BLGData returns an array of CalendarEvents cast to object before it is sendt back to the calling script. Or at least that is what it looks like when I view his plugin with DotPeek. I am going to try to test this in vb.net (MoskusSample) to see if I can get it to work. If it works in vb.net then it "should" work in C#...
Alex Khassapov
@alexbk66
I tried a test app - HS doesn't understand my object I return, I tried to log just obj.GetType().Name - nothing. Kind of what I was expecting.
However other Blade plugins also return arrays of objects, i.e.
For Each r As Object In hs.PluginFunction("BLOnkyo", "", "Receivers", Nothing) hs.writelog("Info", "Name: " & r.Name & " is a receiver!") Next
So the best option is to ask Blade in forum. You got me interested :)
Alex Khassapov
@alexbk66
One possible explanation - Blade is using VB and you C#?
Odd Erik Midthaug
@oesolberg
Maybe. I will find out later today I think. But VB.Net and C# should produce the same kind of code hence give the same possibilities.
Odd Erik Midthaug
@oesolberg
Nope. Does not work better in VB.Net. Time to enter the messageboard
Alex Khassapov
@alexbk66
I spent two days googling and trying, nothing really helpful. If not Blades plugins - I would say - it's not possible. So Blade is the only hope.
Odd Erik Midthaug
@oesolberg
It is possible. The problem is that we are not seeing the obvious. I guess you are also testing by running the plugin remote. If so HomeSeer will not know about the class you are returning since it is remote. When HS runs the plugin it can inspect the running exe (this is important) and create the needed Serializable classes in the return object.
I got it working!
Odd Erik Midthaug
@oesolberg
And you might need to set all variables in returning object to something.
Not sure yet, but at least I got something working
Odd Erik Midthaug
@oesolberg
Nope, you dont need to set all variables in the returning object. But - IT WORKS ! - yay!
Alex Khassapov
@alexbk66
Yeah, I worked it out too, the exe should be local in HS root - then it can de-serialise the object
Alex Khassapov
@alexbk66
This guy Bill Sobel is pretty annoying
Odd Erik Midthaug
@oesolberg
He has some valid points. I am not familiar with remoting so all that stuff is new to me. Guess I should read up a bit about it.
Alex Khassapov
@alexbk66
You don't really need to understand .NET remoting, just the lessons we learned - which should be really documented. I.e. that HS loads the plugin executable to extract the class declaration using Reflection.
And his comments about sticking to basic objects was not any help - not answering the original question. And the mentoring patronising tone...
Odd Erik Midthaug
@oesolberg
Cool. I will check it out to see if there are any good thoughts I could borrow :-)
Odd Erik Midthaug
@oesolberg
I see that you have linked configs to html-pages. Should not these html-pages exist in the solution?
Alex Khassapov
@alexbk66
I'm not sure what you mean?
And probably HS forum is netter for discussion - so other users can see it.
Odd Erik Midthaug
@oesolberg
RegisterWebPageDesc(Name + " Help", "AKSmartDevice/AKSmartDeviceVer1.htm", "Help1", helplink: true);
RegisterWebPageDesc("Help", "/AKSmartDevice/AKSmartDeviceVer1.htm", "Help2", helplink: false);
Odd Erik Midthaug
@oesolberg
It is not what you do, but the htm-files you are linking to. Should they not be included in the project?
Alex Khassapov
@alexbk66
Ah, yes, they are included in my Smart Device plugin installer. You can try it. http://plugins.homeseer.com/releasenotes?productid=313
Odd Erik Midthaug
@oesolberg
Ah, cool.
Odd Erik Midthaug
@oesolberg
Kudos for making a plugin and adding it to the store.
Alex Khassapov
@alexbk66
Thank you
Odd Erik Midthaug
@oesolberg
Anyone here found out how to have a confirmation dialog to a button in a html page (confirmation dialog when pressing a clsJQuery.jqButton)? Or is there any other way to have a dialog before posting to your plugin?
Alex Khassapov
@alexbk66
I gave-up and just post normally to my plugin when button is pressed - then in my plugin I add a message to my config page (red text) "please press again"
Odd Erik Midthaug
@oesolberg
Haha, I know the feeling. Thanks for the info.
Odd Erik Midthaug
@oesolberg
OK, no response in the forum so I made my own button stealing lots of the original code
Now I check if the return is Submit or Cancel
Alex Khassapov
@alexbk66
Looks good.
Odd Erik Midthaug
@oesolberg
Some adjustments still since I have hard coded a bit too much, but I try to update the gist when I find errors.
Alex Dresko
@alexdresko

use HSPI for RC522 rfid - <p>I want to use Grade HSPI
instead of Grade VSPI
and I don't know how to
do it. I did a bit of
searching but I couldn't
find anything.</p>

<pre><code> #include <SPI.h>
#include <MFRC522.h>

#define RST_PIN 4 // Configurable, see typical pin layout above
#define SS_PIN 2 // Configurable, see typical pin layout above

MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance

//*//
void setup() {
Serial.begin(9600); // Initialize serial communications with the PC
SPI.begin(); // Init SPI bus
mfrc522.PCD_Init(); // Init MFRC522 card
Serial.println("Read personal data on a MIFARE PICC:"); //shows in serial that it is ready to read
}

//*//
void loop() {

if ( mfrc522.PICC_IsNewCardPresent()) {
if ( mfrc522.PICC_ReadCardSerial()) {
Serial.println(F("tag:"));
for (byte i = 0; i < mfrc522.uid.size; i++){
Serial.print(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " ");
Serial.print(mfrc522.uid.uidByte[i],HEX);
}
Serial.println();
mfrc522.PICC_HaltA();
}
}
}
</code></pre>
https://stackoverflow.com/questions/61310418/use-hspi-for-rc522-rfid <p>I want to use Grade HSPI
instead of Grade VSPI
and I don't know how to
do it. I did a bit of
searching but I couldn't
find anything.</p>

<pre><code> #include <SPI.h>
#include <MFRC522.h>

#define RST_PIN 4 // Configurable, see typical pin layout above
#define SS_PIN 2 // Configurable, see typical pin layout above

MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance

//*//
void setup() {
Serial.begin(9600); // Initialize serial communications with the PC
SPI.begin(); // Init SPI bus
mfrc522.PCD_Init(); // Init MFRC522 card
Serial.println("Read personal data on a MIFARE PICC:"); //shows in serial that it is ready to read
}

//*//
void loop() {

if ( mfrc522.PICC_IsNewCardPresent()) {
if ( mfrc522.PICC_ReadCardSerial()) {
Serial.println(F("tag:"));
for (byte i = 0; i < mfrc522.uid.size; i++){
Serial.print(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " ");
Serial.print(mfrc522.uid.uidByte[i],HEX);
}
Serial.println();
mfrc522.PICC_HaltA();
}
}
}
</code></pre>

Alex Dresko
@alexdresko
ESP32 HSpi Doesn't work after using ESP flash download tool - <p>I am using esp32 wroom32 divKit, with arduino IDE, I had a problem with the kit it was resetting after search for a solution, it is solved using ESP flash download tool software and the kit is working, but after using this software the spi protocol doesn't work, is there any solution to reconfigure the kit to its default configuration ??</p>
https://stackoverflow.com/questions/61322116/esp32-hspi-doesnt-work-after-using-esp-flash-download-tool <p>I am using esp32 wroom32 divKit, with arduino IDE, I had a problem with the kit it was resetting after search for a solution, it is solved using ESP flash download tool software and the kit is working, but after using this software the spi protocol doesn't work, is there any solution to reconfigure the kit to its default configuration ??</p>
Alex Dresko
@alexdresko

Multiple SD cards on ESP32 - <p>i'm trying to connect 2 SD cards via SPI bus to my ESP32, i believe it is possible with SDFat library, but i cant even understand how to connect even one. It was working fine with SD.h, can someone explain how to?</p>

<pre><code>#include <SdFat.h>

include <stdio.h>

include <stdlib.h>

include <sqlite3.h>

include <SPI.h>

include <FS.h>

define SD1_CS 12

define SD2_CS 15

SdFs SD1;
SdFs SD2;

void setup() {
Serial.begin(115200);
SPI.begin();
while (!SD1.begin( SD1_CS)){
Serial.println("Card 1 Mount Failed");
}
while (!SD2.begin( SD2_CS)){
Serial.println("Card 2 Mount Failed");
}
}

void loop() {
// put your main code here, to run repeatedly:

}
</code></pre>

<p>And one more question, is it possible to use it on the second SPI bus? HSPI</p>
https://stackoverflow.com/questions/68860561/multiple-sd-cards-on-esp32 <p>i'm trying to connect 2 SD cards via SPI bus to my ESP32, i believe it is possible with SDFat library, but i cant even understand how to connect even one. It was working fine with SD.h, can someone explain how to?</p>
<pre><code>#include <SdFat.h>
#include <stdio.h>
#include <stdlib.h>
#include <sqlite3.h>
#include <SPI.h>
#include <FS.h>

#define SD1_CS 12
#define SD2_CS 15

SdFs SD1;
SdFs SD2;

void setup() {
Serial.begin(115200);
SPI.begin();
while (!SD1.begin( SD1_CS)){
Serial.println("Card 1 Mount Failed");
}
while (!SD2.begin( SD2_CS)){
Serial.println("Card 2 Mount Failed");
}
}

void loop() {
// put your main code here, to run repeatedly:

}
</code></pre>
<p>And one more question, is it possible to use it on the second SPI bus? HSPI</p>

Alex Dresko
@alexdresko
HSPI-v$(appveyor-build-version): Merge pull request #41 from alexdresko/doc_updates <p>Doc updates</p> https://github.com/alexdresko/HSPI/releases/tag/HSPI-v%24(appveyor-build-version)

Multiple SD cards on ESP32 - <p>i'm trying to connect 2 SD cards via SPI bus to my ESP32, I believe it is possible with SDFat library, but I can't even understand how to connect even a single one. It was working fine with <em>SD.h</em>, can someone explain me how to?</p>

<pre class="lang-c prettyprint-override"><code>#include <SdFat.h>

include <stdio.h>

include <stdlib.h>

include <sqlite3.h>

include <SPI.h>

include <FS.h>

define SD1_CS 12

define SD2_CS 15

SdFs SD1;
SdFs SD2;

void setup() {
Serial.begin(115200);
SPI.begin();
while (!SD1.begin(SD1_CS)) {
Serial.println("Card 1 Mount Failed");
}
while (!SD2.begin(SD2_CS)) {
Serial.println("Card 2 Mount Failed");
}
}

void loop() {
// put your main code here, to run repeatedly:
}
</code></pre>

<p>And one more question, is it possible to use it on the second SPI bus (which is HSPI)?</p>
https://stackoverflow.com/questions/68860561/multiple-sd-cards-on-esp32 <p>i'm trying to connect 2 SD cards via SPI bus to my ESP32, I believe it is possible with SDFat library, but I can't even understand how to connect even a single one. It was working fine with <em>SD.h</em>, can someone explain me how to?</p>
<pre class="lang-c prettyprint-override"><code>#include <SdFat.h>
#include <stdio.h>
#include <stdlib.h>
#include <sqlite3.h>
#include <SPI.h>
#include <FS.h>

#define SD1_CS 12
#define SD2_CS 15

SdFs SD1;
SdFs SD2;

void setup() {
Serial.begin(115200);
SPI.begin();
while (!SD1.begin(SD1_CS)) {
Serial.println("Card 1 Mount Failed");
}
while (!SD2.begin(SD2_CS)) {
Serial.println("Card 2 Mount Failed");
}
}

void loop() {
// put your main code here, to run repeatedly:
}
</code></pre>
<p>And one more question, is it possible to use it on the second SPI bus (which is HSPI)?</p>