Tutorial and examples - Ideas/wish list

I’m almost there but I have family obligations so it will be done this afternoon. Lot’s of little things to fix but very straight forward. :smile:

Hi @Bradders

I had not seen PushOver.net before. Folks are using pushingbox.com and Prowl.

One thing that may make PushOver.net hard to work with is that the Spark core cannot do https (that is SSL/TLS) connections yet. Other service I mentioned with work with straight http. Only you can decide if this is enough security for what you are doing with the service.

This is one reason why the new spark.Publish() API is so cool–it uses the Spark cloud crypto so your data is secure to the cloud and then the SSE, Spark variables and Spark functions API at api.spark.io all use https (with SSL/TLS) for the Spark cloud connection back to you.

kennethlimcp, I have posted the webIDE compatible code for ModBusMaster on my github. As you pointed out, I had to add an _crc16_update function (from the crc16 library) and a word(h,l) function for converting two bytes to a 16bit word. I also fixed the Serial port class assignment since HardwareSerial does not exist and defaulted it to Serial 1. I made provisions for later adding Serial2 once that is added to the Core firmware. And of course, I added #include “appplication.h”. It compile in the webIDE and should run just fine assuming, of course, there is a compatible RS485/RS232 converter as required. Let me know how it works when you get there. :smile:

BTW, one thing I did not modify are the pins used in the code when using MODBUSMASTER_DEBUG. If you use the debug code, make sure to define the correct output pins.

@bko

To be honest I’m not fussy which service I use, I’m just interested in sending push notifications to an iOS device either directly from the Core (preferred) or from the Core via a my website the Core is connected to.

Which would you recommend? are there any bits of example code?

Thanks again!

Hi @Bradders

pushingbox.com is dead-simple to use but you have to give their site access to your google account and the security of the over-the-air from the core part is nil. This could still be OK if all the bad guys can do is send you notifications. They just introduced new hardware that uses there service too.

Prowlapp.com is very popular on iOS and would work great too. A cool thing to have would be Spark.publish() to prowl notification. This would not be hard to do, but you need a host on net to broker the transaction.

One other option that I have tried is sending email–there is a thread where this is some sample code if you search the forum. For me, I needed to use my ISP email server, which I never use anyway, since you are inside the ISP network, you can get away with not using SSL/TLS encryption. Look for your ISP’s instructions on how to set up a scanner/copier that can email the scans to you since these are often limited to no encryption too. Others have said mailgun.com works well but that is more of a paid service that offers a free level. On iOS, email notifications work great for me.

I think you need to experiment and see which of these (or others) works for you–there does not seem to be a one-size-fits-all solution to this problem.

Not a tutorial per se, but a single-page official pinout diagram (like the ones made by pighixx) with “what do the Spark LED colors/patterns mean again” cheatsheet would be handy.

NetIO looks cool. Could be a great tool for people like me who are new at web side of things. However, it seems they are not ready yet for integration with spark core. They don’t support http POST. There is discussion [here][1] in case you are interested.

Does anyone know any similar tool or a workaround?
[1]: http://netio.davideickhoff.de/en/forum/topic/1325/

1 Like

There have been some sample apps, not quite the same pre-packaged ios apps, but here are a few:

http://jflasher.github.io/spark-helper/


Thanks,
David

Hi,

I was following up on a conversation between you and kennethlimpc in MArch. Did you end up porting to Modbus library to the Spark Core?

@asmallri, the conversation include a link to the githup repo where you can find the port :smile:

Thanks for helping to port the code :smiley:

I would appreciate this modbus port to Sparkcore. This is still a protocol that is an industry standard and could open up opportiniuties. A tutorial on how to use this with an available RS232RS485 shield would be helpful

1 Like

@mtoko,

can you tell me more about the use case and what i can do to make it a good shield?

@kennethlimcp, I believe @mtoko is looking to understand how to use the library with an off-the-shelf shield. However, like you asked, I would like to know the use case. :smile:

1 Like

@kennethlimcp @peekay123 Thanks for the response. I am in the building automation and energy services industry and Modbus is still a widely used protocol. The use case would be to add Sparkcore to a range of existing products variable speed drives and in particular electricity/energy meters to provide IOT functionality. The recent launch of the Dashboard as a management tool is ideal for this opportunity

1 Like

@mtoko, the Spark port used the ModbusMaster library for Arduino.

I ported the library for a member and have not used it myself. I suggest that you may be the best person to create such a tutorial since you seem to be using this bus yourself. I would gladly help with any issues you have with the ported code but not really beyond that.

2 Likes

Hi peekay123, sorry to trouble you .I think I met a problem you have met before.I have an Arduino project which used HardwareSerial that does not exist in Particle.But I need to use something like that.You can see my code in https://github.com/robopeak/rplidar_arduino/blob/master/RPLidarDriver/RPLidar.h what can I do to make my Particle project run same as the Arduino project.
Thank you for you help.

@Sangchaoqiang, use USARTSerial instead of HardwareSerial and specify Serial1 or Serial2 as the serial devices (Serial is used by the USB port). :slight_smile:

Thank you for your help. I have corrected my error. Thanks

1 Like