How to get source code for modbus slave(RTU) for pic microcontroller. Kindly suggest [duplicate] - modbus

This question already has answers here:
Modbus stack for Microchip PIC
(4 answers)
Closed 3 years ago.
I am looking for basic Modbus RTu slave code for PIC using rs485. Please guide me to get source code or develop source code &
What are function i need to take care while developing it

liblightmodbus is a very lightweight, highly configurable, platform-independent Modbus RTU library.

This is the closest I could find: freemodbus.
There is a port to PIC32xx but I did not test it.
There used to be a bunch of projects implementing Modbus for PIC microcontrollers but most of them are old, with dead links and nowhere to be found anymore.
With Arduino & friends and SBCs running so cheap nobody seems to be into this kind of thing with PIC anymore.

Related

STM32 with LCD 2004 + I2C, can't communicate

I am using a STM32F030F4P6 MCU and a LCD 2004 with PCF8574T I2C display driver. I have tried the library from this tutorial: https://controllerstech.com/interface-lcd-16x2-with-stm32-without-i2c/. I have found a datasheet for the PCF8574T device, but there are no commands specified in there. I am quite new in the field, but I already communicated with other devices over I2C and SPI and got them to work. Can somebody tell me what I am doing wrong, or at least show me where to get a datasheet with commands for the device? I am sorry in advance if this is a noob question.
As already mentioned, PCF8574T - is an i2c expander. So you need to write a driver which manipulates data pins on PCF8574T in way described in tutorial you found.
Check the arduino code for this type of LCD. It may save your time/ https://github.com/fdebrabander/Arduino-LiquidCrystal-I2C-library
If you have an Arduino board, you can test your LCD according this tutorial https://create.arduino.cc/projecthub/Arnov_Sharma_makes/lcd-i2c-tutorial-664e5a
Nice to know that your device still alive before debug the code.

How to get list of devices thst are connected to router using program

Using c programing i need to display mac address of the devices which are connected to router on terminal.I tried with so many things bt still i am not getting the exact output.Else any command is there to get that details please share.i am doing project based on this so please if anyone know means share the answers.
Not sure about doing it with C, but I have a look at ettercap you could use some command line script to to easily get info about all connected devices a local network.
What you are looking for is to write your your arp-scan.
To do this basically you'll need to write or use existing C based ping code. Apple has a nice simple ping.
Here is the link to apple's simple ping -
simplePing
Then you will want to open your devices arp-table. This will vary based on device but there should be some way to make C code compatible across a narrow range of devices.
Here is an interesting code review involving what you are looking for.
Post is here

Using iPhone serial connection (pins 12 and 13)

Ok, so I've never done anything with serial connections before. But...
I just got an Arduino that I am trying to use to remotely launch model rockets. I have a 5 volt relay that I can control with the Arduino's digital out.
Now, I want connect my iPhone's Tx to the Arduino's Rx and vice-versa. I would buy the iPhone breakout board from spark fun so I could connect it to the Arduino. (http://www.sparkfun.com/products/10645) I was thinking something along the lines of: when the phone gets a text or a call from a certain number, or maybe even just a bluetooth signal, it would tell the Arduino. But those are just ideas.
How can I actually send a signal from my iPhone? Are there xCode libraries to do this? My phone is jailbroken, so I am open to other non-apple ways for sending signals. But I am a novice programmer.
Thank you.
P.S. I'm new to Stack Overflow, and I would appreciate if you could help me. The first time I posted a question someone told me it wasn't on the right site. So please bear with me.
EDIT #1: Haha, I just read over this and it sounds like a cell phone bomb from a terrorist movie. I swear that's not what I'm doing. Just look at my avatar.
EDIT #2: I also have a Bluetooth dongle for the Arduino. But I honestly have no idea how to interface that with anything, it was $10 from China, so I thought I would buy it to keep my options open. But, regardless, it would be really cool to plug an iPhone into an Arduino.
You could buy a Redpark Serial Cable for iOS to connect the iPhone to your Arduino board over RS-232.
This book also seems to be helpful: iOS Sensor Apps with Arduino
EDIT:
Redpark FAQ: http://redpark.com/c2db9_FAQs.html
There is a SDK available for this serial cable.
You will have trouble writing communication software when trying to connect directly to the dock connector! The External Accessory Framework wont help you here unless your Arduino board has a special decoding chip for dock connector communication.
Have fun!
All I think you need to do is utilize the External Accessory framework. I'm not sure how well it will work for you, the library is meant to communicate with MFi approved accessories. I'd really like to hear how your results went, I am going to be conducting an experiment of my own using a break out board
I am in a similar boat as you, and I have successfully built my own serial cable using the podbreakout, and have implemented a serial class that supports reading / writing. I can confirm that I have read working, as I have tested it with my RFID reader. I am in the process of writing code that will send a command to the Arduino from the iPhone, and then have the Arduino perform a task based on the command.
Here is a document I put together on iDevice serial com,
https://docs.google.com/document/d/1Yi9_hcw8XSyYNCG2OJT9oHlTG-dC-Dnuc58VIULa81Q/edit?usp=sharing
and the serial class can be seen in the project I am working on.
https://github.com/ipatch/KegCop

UDPEcho or C Code?

Im making an iPhone application that sends commands and retrieves data through an UDP connection.
I have a question, since my previous question did not get answered and I was not able to fix it by now I am looking for two other ways to implement an UDP connection.
UDPEcho
C code
Which one is better [advantages/disadvantages] and which one is easier or recommended to implement it into an iphone application?
UDPEcho already set up the iOS project for you, so unless you need to port your app to other platforms afterwards, that would give you a headstart compared to C code.

Mqtt protocol for windows phone

How to use the mqtt protocol in windows phone.I got code from mqtt site which is an .net application and i am able to run that app successfully,but when i am trying to incorporate the same thing in windows phone i got 3 errors.
1)hashtable is not recognized so i substituted dictonary<>
2)tcpclient is not recognized...can anyone tell me some alternative
3)networkstream is not recognized...
so please can anyone suggest me some alternative for tcpclient and networkstream.
Basically we want to implement push notification without help of mpns in windows phone.
I believe that TCP sockets are now supported for Windows Phone 7 apps (since the Mango SDK update).
Check out http://msdn.microsoft.com/en-us/library/hh202858(VS.92).aspx for a sample and tutorial.
Good luck!