TT_ZX Posted August 5, 2011 Report Share Posted August 5, 2011 I'm having trouble with an Enfora modem. With a baud rate of 9600 it will initialise fine. Anything above this and it fails (SB81 = 1). Using Prepare PLC Side Modem completes successfully at 57600 and from the documentation I've read the V1040 should work with this. I would like to be able to connect remotely but at 9600 it is far to slow to be usable. Hopefully someone can shed some light on this problem for me. Thanks in advanced, Justin Link to comment Share on other sites More sharing options...
Flavien Posted August 5, 2011 Report Share Posted August 5, 2011 Hello, Did you changed the baud rate at the "Prepare PLC side Modem" window? If not, try to change them as it is showed on the pictures, This worked for me, Link to comment Share on other sites More sharing options...
TT_ZX Posted August 7, 2011 Author Report Share Posted August 7, 2011 Thanks Flavien. The modem will now initialise on the PLC. However I am not able to establish a connection at 57600. I get a dial time out error. I can still connect at 9600. Have you been able to establish a connection at 57600? Do you make any changes to the settings when initialising the PC side modem or before dialling out? Link to comment Share on other sites More sharing options...
MVP 2014 Simon Posted August 8, 2011 MVP 2014 Report Share Posted August 8, 2011 Not sure how it works elsewere, but in Australia the network sets the baud rate for dial-in (CSD) GSM connections at 9600baud. Since GSM base stations are only made by a few manufactuers, I presume this is going to be reasonably consistent across the globe. I have tried setting the modems to 57600, but it does crash out. I presume the 9600baud GSM link causes timeout and/or buffer problkems with the 57600baud local serial links For high data rate the other options are to use a Packet Switched Connection (like GPRS) or use a stand-alone broadband modem with Ethernet (and fit ethernet to the PLC). Link to comment Share on other sites More sharing options...
Flavien Posted August 8, 2011 Report Share Posted August 8, 2011 Thanks Flavien. The modem will now initialise on the PLC. However I am not able to establish a connection at 57600. I get a dial time out error. I can still connect at 9600. Have you been able to establish a connection at 57600? Do you make any changes to the settings when initialising the PC side modem or before dialling out? Well, I never had any problem to send SMS at this baudrate with enfora modems, but I never tried to establish a connection at this rate. The changes I told you is the only one I do when I want to initialize an enfora modem. I'm afraid you should try a lower speed until it works, unfortunately I don't have a lot of experiences on this... Link to comment Share on other sites More sharing options...
TT_ZX Posted August 8, 2011 Author Report Share Posted August 8, 2011 Not sure how it works elsewere, but in Australia the network sets the baud rate for dial-in (CSD) GSM connections at 9600baud. Since GSM base stations are only made by a few manufactuers, I presume this is going to be reasonably consistent across the globe. I have tried setting the modems to 57600, but it does crash out. I presume the 9600baud GSM link causes timeout and/or buffer problkems with the 57600baud local serial links For high data rate the other options are to use a Packet Switched Connection (like GPRS) or use a stand-alone broadband modem with Ethernet (and fit ethernet to the PLC). Hi Simon. I'm in New Zealand, so it is likely that we use the same system over here. What is required to set up a Packet Switched Connection? I was trying to avoid the broadband band route because I need the SMS capabilities. Are you able to send SMS with a Packet Switched Connection set up? Link to comment Share on other sites More sharing options...
MVP 2014 Simon Posted August 10, 2011 MVP 2014 Report Share Posted August 10, 2011 Flavien: Well, I never had any problem to send SMS at this baudrate with enfora modems, but I never tried to establish a connection at this rate. SMS will work fine at the higher baud rate since it just involves comms between the PLC and the modem (then the modem "does its own thing" as far as sending the SMS onto the GSM network). It's just the dial-up connection that seems to work best at 9600 since the "over the air" data rate is limited to 9600, and there is an end-to-end connection involved. TT-ZX: If you use GPRS you can use SMS on the same modem. There is a good example for GPRS in the Visilogic help files. Basically you use SMS as the primary method of communication with the PLC. When you want to set up a GPRS conneciton, send the PLC an SMS to initiate the GPRS connection from the PLC end. When you are finished with the GPRS connection, either terminatie it in the PLC from the remote connection or have a timout on the PLC that drops the GPRS once there is no host connected or no data for a certain period of time. The limitation is that you can't send or receive an SMS with the GPRS connection active. For this to work you also need to set up port forwarding in your PC internet connection, and know what the current public IP address of your PC broadbnad modem is (or pay for a static IP address on your PC connection). If you go the route of using an Ethernet broadband modem, then SMS is usually not an option. We have a customer who has tried in vain to find an ethernet modem that also has a serial port that allows SMS. One possible option is to use email instead of SMS. Link to comment Share on other sites More sharing options...
TT_ZX Posted August 11, 2011 Author Report Share Posted August 11, 2011 Thanks Simon, you've been a great help explaining this stuff. Is it possible to initiate a connection from the PC end after PLC has established the GPRS connection. Setting up port forwarding on the PC ADSL modem will be a pain for various reasons. Link to comment Share on other sites More sharing options...
MVP 2014 Simon Posted August 11, 2011 MVP 2014 Report Share Posted August 11, 2011 It is possible to set up the PLC GPRS connection in listen mode, but I haven't done it. However you now have the same problem turned around the opposite way. Once the PLC has registered on the GPRS network you need to know it's IP address. So have it send you it's IP address via SMS before putting itself into GPRS listen mode. You probably need a GPRS_RUN FB in there somwhere as well. Another gotcha is that the cellular provider may block incoming requests to the GPRS device, particularly if they come from outside the cellular network. If it doesn't work from an ADSL (or similar) cable-based internet connection, try connecting with another GPRS modem using the same cellular provider as the remote PLC modem. Remeber that the main commercial use for GPRS is internet browsing on mobile phones - so teenagers can do important things like get on facebook and download ringtones. Link to comment Share on other sites More sharing options...
TT_ZX Posted August 11, 2011 Author Report Share Posted August 11, 2011 . Sounds promising. I think I'll try and establish a connection from a PC on ADSL to another using the Enfora modem to confirm that it is possible using my sim card. I have 2 Enfora modems which may come in handy for diagnosing connection problems. Once I can get this to work I'll set it up on the PLC. I'll let you know how I get on. Link to comment Share on other sites More sharing options...
MVP 2014 Simon Posted August 11, 2011 MVP 2014 Report Share Posted August 11, 2011 Having spare modems and testing in a "safe" environenment is a very good idea. Nothing worse than waiting until you are on site before trying something new... Link to comment Share on other sites More sharing options...
TT_ZX Posted August 29, 2011 Author Report Share Posted August 29, 2011 Well, after a full day of testing I'm giving up on remote access via the GSM modem. I managed to establish a remote connection with the PLC in call mode on Friday but it did not work on Monday (I checked the IP address etc). This mode is not desirable anyway because it will only work if port forwarding is set up in the adsl router. I never managed to establish a connection with the PLC in listen mode. Using the correct APN this should have worked but it did not. Using the same sim card in my android phone I could ping the phone from an adsl connection but I could not ping the PLC nor connect to it. I just couldn't get a response from the PLC. I don't know how to use the modem to establish a connection to the internet from my PC to test the modem any further. I imagine some drivers are needed but I couldn't find anything. I had another issue where the modem would not receive any SMS messages after a call to the PC was made and after unregistering from the GSM network. It will not work again until the PLC is reset. If anyone could shed some light on these issues I will have another go but it isn't looking promising. Link to comment Share on other sites More sharing options...
Ofir Posted August 31, 2011 Report Share Posted August 31, 2011 Hi, First please note that GPRS and SMS cannot work at the same time. After using any GPRS functionality, you must activate the SMS CONFIG again to be able receive and send SMS messages. Another note is that you must also disable the SMS SCAN while using GPRS. Regarding the APN settings: This limitations related only to the provider of the SIM card. If you will have public static IP address then you will be able also to connect the PLC in listen mode. Also when you call from the PLC to the PC, if you do not wish to use port forwarding then your PC must have public static IP address. Link to comment Share on other sites More sharing options...
MVP 2014 Simon Posted September 1, 2011 MVP 2014 Report Share Posted September 1, 2011 Good point about the SMS Scan conflicting with GPRS. Ditto if you are using the SMS CSQ function to periodically check signal strength. It sounds like you are close. If you were able to connect once by calling from the PLC to your PC, that would indicate the APN and so-on are correct in the PLC modem. I would persist with establishing that you can get a reliable connection by calling from the PLC back to your PC, even if that is not the desired mode. If it is not working consistently in call mode, then you don't really know where you stand once you start to try it in listen mode. To test the modem from a PC, set up a standard Windows Dial-Up Networking connection using the serial port that the modem is connected to. For the phone number put *99#. When you dial that number the modem should initiate a GPRS session, and if ti is susscessful the Dial-Up Networking system on the PC should indiate you have an internet connection. This might sound silly, but is another valuable insight I have from my initial attempts to set up GPRS. After your partial success, turn everything off, disconnect the cables, put it all in a box and go do something else. Come back the next day and set it all up again and start fresh. The temptation is to leave it running and keep tweaking to try and make it work. Some problems give you direct clues to help you solve it, but I have found with modem setup that if one thing is wrong it just doesn't work. Also, do you have a COM port sniffer? This is essential for debugging modem comms and taking away the dread fear that something is happening but you don't know what. Search the Visilogic help file for "sniffer". There is one built in to the V1040 info mode, but for "power sniffing" I would use the hardware based one that allows you to see the results in Hyperterminal. That way you can capture and save results. Build it yourself based on the instructions in the help or order it from Unitronics, MJ10-22-CS16. Link to comment Share on other sites More sharing options...
MVP 2014 Simon Posted September 1, 2011 MVP 2014 Report Share Posted September 1, 2011 Also make sure the "Ignore Break" option is checked in the COM INIT block in the PLC project in Visilogic. The "break" command is a binary sequence that is used to reset the PLC com port to known parameters. Once you enter a GPRS session, the data stream is raw binary data and could (by random chance) contain the break sequence. By checking "Ignore Break", you prevent any random occurrences of the break sequence from stopping communication. The only downside is that this disables the ability for Visilogic to automaically match baud rates with the PLC, when communicating on the port you are using for the modem. This is a moot point for the V1040 as it has 2 ports. But should you need to use Visilogic on the port that is configured for the modem, just be sure to enter the correct, matching baud rate in the Visilogic PLC comms parameters and all shoud be OK. Link to comment Share on other sites More sharing options...
TT_ZX Posted September 1, 2011 Author Report Share Posted September 1, 2011 Hi, First please note that GPRS and SMS cannot work at the same time. After using any GPRS functionality, you must activate the SMS CONFIG again to be able receive and send SMS messages. Another note is that you must also disable the SMS SCAN while using GPRS. Regarding the APN settings: This limitations related only to the provider of the SIM card. If you will have public static IP address then you will be able also to connect the PLC in listen mode. Also when you call from the PLC to the PC, if you do not wish to use port forwarding then your PC must have public static IP address. Thanks for the info, this solves some of my issues. Should I be able to ping the PLC with it in listen mode? So far I have not and this not a limitation with the sim. Maybe I need to specify a port? Link to comment Share on other sites More sharing options...
TT_ZX Posted September 1, 2011 Author Report Share Posted September 1, 2011 Thanks for your help guys. This new information allows me to push on and see if I can get this to work reliably. If I am using the GPRS_call FB with the IP address via MI, is the IP made up from 4 consecutive MI's? If not how do I put the IP into one MI? Link to comment Share on other sites More sharing options...
Ofir Posted September 1, 2011 Report Share Posted September 1, 2011 Hi, I have a SIM card with public static IP which after registration to the provider network I'm able to ping its IP, in other hand I have another SIM card which does not have public static IP and after registration I'm not able to ping the IP address. Anyway I belive that this relates to the provider setting. As you mentioned also ping is working on specific port which must be enabled by the provider. Indeed if the IP address is linked to MI, the IP made up from 4 consecutive MI's. Link to comment Share on other sites More sharing options...
TT_ZX Posted September 1, 2011 Author Report Share Posted September 1, 2011 Hi, I have a SIM card with public static IP which after registration to the provider network I'm able to ping its IP, in other hand I have another SIM card which does not have public static IP and after registration I'm not able to ping the IP address. Anyway I belive that this relates to the provider setting. As you mentioned also ping is working on specific port which must be enabled by the provider. Indeed if the IP address is linked to MI, the IP made up from 4 consecutive MI's. I have a sim in my phone that with the correct APN setting I can ping my phone. If I put this sim in the Enfora and use the same APN I cannot ping the PLC. Hopefully when I've fixed the other issues you have pointed out this will work. We have a dynamic IP address and I am using the dyndns service to host services (email etc). I'm going to try and use the DNS Resolver FB to update the IP address before the GPRS Start Call FB. If this doesn't work, I will just SMS the current IP to the PLC before the GPRS Start Call FB. I've got plenty to go on for now. I'll keep you updated on my progress. Thanks, Justin Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now